Skip to content

Commit 37af428

Browse files
committed
Add app
0 parents  commit 37af428

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+963
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
.DS_Store
3+
dist/
4+
typings/
5+
*.orig
6+
.idea/
7+
*/src/**/*.js.map
8+
*.log
9+
package-lock.json
10+
coverage/
11+
.awcache/

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

00-start/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}

00-start/.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

00-start/.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

00-start/config/webpack/base.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
const HtmlWebpackPlugin = require('html-webpack-plugin');
2+
const { CheckerPlugin } = require('awesome-typescript-loader');
3+
const merge = require('webpack-merge');
4+
const helpers = require('./helpers');
5+
6+
module.exports = merge(
7+
{},
8+
{
9+
context: helpers.resolveFromRootPath('src'),
10+
resolve: {
11+
extensions: ['.js', '.ts', '.tsx'],
12+
alias: {
13+
common: helpers.resolveFromRootPath('src/common'),
14+
core: helpers.resolveFromRootPath('src/core'),
15+
layout: helpers.resolveFromRootPath('src/layout'),
16+
pods: helpers.resolveFromRootPath('src/pods'),
17+
scenes: helpers.resolveFromRootPath('src/scenes'),
18+
},
19+
},
20+
entry: {
21+
app: ['regenerator-runtime/runtime', './index.tsx'],
22+
},
23+
module: {
24+
rules: [
25+
{
26+
test: /\.tsx?$/,
27+
exclude: /node_modules/,
28+
loader: 'awesome-typescript-loader',
29+
options: {
30+
useBabel: true,
31+
useCache: true,
32+
babelCore: '@babel/core',
33+
},
34+
},
35+
],
36+
},
37+
optimization: {
38+
splitChunks: {
39+
cacheGroups: {
40+
vendor: {
41+
chunks: 'all',
42+
name: 'vendor',
43+
test: /[\\/]node_modules[\\/]/,
44+
enforce: true,
45+
},
46+
},
47+
},
48+
},
49+
plugins: [
50+
new HtmlWebpackPlugin({
51+
filename: 'index.html',
52+
template: 'index.html',
53+
}),
54+
new CheckerPlugin(),
55+
],
56+
}
57+
);

00-start/config/webpack/dev.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const merge = require('webpack-merge');
2+
const base = require('./base');
3+
const helpers = require('./helpers');
4+
5+
module.exports = merge(base, {
6+
mode: 'development',
7+
devtool: 'inline-source-map',
8+
output: {
9+
path: helpers.resolveFromRootPath('dist'),
10+
filename: '[name].js',
11+
},
12+
devServer: {
13+
inline: true,
14+
host: 'localhost',
15+
port: 8080,
16+
stats: 'minimal',
17+
hot: true,
18+
},
19+
});

00-start/config/webpack/helpers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const path = require('path');
2+
3+
const rootPath = path.resolve(__dirname, '../../');
4+
5+
exports.resolveFromRootPath = (...args) => path.join(rootPath, ...args);

00-start/config/webpack/prod.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const merge = require('webpack-merge');
2+
const base = require('./base');
3+
const helpers = require('./helpers');
4+
5+
module.exports = merge(base, {
6+
mode: 'production',
7+
output: {
8+
path: helpers.resolveFromRootPath('dist'),
9+
filename: './js/[name].[chunkhash].js',
10+
},
11+
});

0 commit comments

Comments
 (0)