Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
98 lines (95 loc) · 2.83 KB
/
Copy pathwebpack.config.js
File metadata and controls
98 lines (95 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const CopyWebpackPlugin = require('copy-webpack-plugin');
const defaultsDeep = require('lodash.defaultsdeep');
const path = require('path');
const webpack = require('webpack');
const base = {
devServer: {
contentBase: false,
host: '0.0.0.0',
port: process.env.PORT || 8008
},
devtool: 'cheap-module-source-map',
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
include: path.resolve(__dirname, 'src'),
query: {
presets: ['es2015']
}
}]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true
})
]
};
module.exports = [
defaultsDeep({}, base, {
target: 'web',
entry: {
'live_view':'./live_view/live_view.js',
'live_view_blocks':'./live_view/live_view_blocks.js',
'test':'./testWebpage/test.js',
'run':'./webtools/run.js',
'example':'./examples/example.js',
//'createTest':'./examples/createTest.js',
'exe_test':'./exe_test/exe_test.js',
},
output: {
filename: '[name].js',
},
plugins: base.plugins.concat([
new CopyWebpackPlugin([{
from: './live_view/live_view.html',
to: 'index.html'
}]),new CopyWebpackPlugin([{
from: './live_view/live_view_blocks.html',
to: 'blocks.html'
}]),
new CopyWebpackPlugin([{
from: './exe_test/exe_test.html',
to: 'exe_test.html'
}]),
new CopyWebpackPlugin([{
from: './testWebpage/test.html',
to: 'test.html'
}]),
new CopyWebpackPlugin([{
from: 'examples/example.html',
to: 'example.html'
}]),
new CopyWebpackPlugin([{
from: 'examples/cdjlogo.jpeg',
to: 'cdjlogo.jpeg'
}]),
new CopyWebpackPlugin([{
from: 'examples/simple.html',
to: 'simple.html'
}]),
new CopyWebpackPlugin([{
from: 'node_modules/scratch-blocks/media',
to: 'static/blocks-media'
}])
]),
})/*,
defaultsDeep({}, base, {
target: 'web',
entry: {
'ScratchLN':'./webtools/scratchify.js',
},
output: {
filename: 'dist/[name].js',
libraryTarget: 'var',
library: 'scratchLN'
},
plugins: base.plugins.concat([
new CopyWebpackPlugin([{
from: 'node_modules/scratch-blocks/media',
to: 'dist/static/blocks-media'
}])
]),
})*/
];