Skip to content

Commit 449494f

Browse files
committed
cleanup client build setup
1 parent 6689cb8 commit 449494f

18 files changed

+273
-14
lines changed

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["env"]
3+
}

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web_modules

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
npm-debug.log
22
node_modules
3-
/client/live.bundle.js
4-
/client/index.bundle.js
5-
/client/sockjs.bundle.js
3+
/client
64
/coverage
75
/ssl/*.pem
86
.idea/
File renamed without changes.
File renamed without changes.
File renamed without changes.

client-src/default/webpack.config.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
4+
5+
module.exports = {
6+
module: {
7+
rules: [
8+
{
9+
test: /\.js$/,
10+
exclude: /node_modules|web_modules/,
11+
use: [
12+
{
13+
loader: 'babel-loader'
14+
}
15+
]
16+
}
17+
]
18+
},
19+
plugins: [
20+
new UglifyJSPlugin()
21+
]
22+
};

client/live.js renamed to client-src/live/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
const $ = require('jquery');
66
const stripAnsi = require('strip-ansi');
7-
const socket = require('./socket');
7+
const socket = require('../default/socket');
88
require('./style.css');
99

1010
let hot = false;
File renamed without changes.
File renamed without changes.
File renamed without changes.

client/webpack.config.js renamed to client-src/live/webpack.config.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

3+
const path = require('path');
34
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
5+
const CopyPlugin = require('copy-webpack-plugin');
46

57
module.exports = {
68
module: {
@@ -10,10 +12,7 @@ module.exports = {
1012
exclude: /node_modules|web_modules/,
1113
use: [
1214
{
13-
loader: 'babel-loader',
14-
options: {
15-
presets: ['env']
16-
}
15+
loader: 'babel-loader'
1716
}
1817
]
1918
},
@@ -33,6 +32,10 @@ module.exports = {
3332
]
3433
},
3534
plugins: [
36-
new UglifyJSPlugin()
35+
new UglifyJSPlugin(),
36+
new CopyPlugin([{
37+
from: path.resolve(__dirname, 'live.html'),
38+
to: path.resolve(__dirname, '../../client/live.html')
39+
}])
3740
]
3841
};
File renamed without changes.
File renamed without changes.

package-lock.json

+229
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)