forked from kujirahand/nadesiko3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
57 lines (49 loc) · 1.22 KB
/
webpack.config.js
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
const path = require('path')
const srcPath = path.join(__dirname, 'src')
const releasePath = path.join(__dirname, 'release')
const editorPath = path.join(__dirname, 'editor')
process.noDeprecation = true
module.exports = {
entry: {
wnako3: [path.join(srcPath, 'wnako3.js')], // plugin_system+plugin_browser含む
plugin_turtle: [path.join(srcPath, 'plugin_turtle.js')],
editor: [path.join(editorPath, 'edit_main.jsx')]
},
output: {
path: releasePath,
filename: '[name].js'
},
// devtool: 'cheap-module-eval-source-map',
plugins: [],
module: {
rules: [
// .jsx file
{
test: /\.jsx$/,
loader: 'babel-loader',
exclude: /node_modules/,
include: [editorPath, srcPath],
query: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
},
// .js file
{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/,
include: [srcPath],
query: {
presets: ['@babel/preset-env']
}
},
{
loaders: ['style-loader', 'css-loader'],
test: /\.css$/
}
]
},
resolve: {
extensions: ['*', '.webpack.js', '.web.js', '.js', '.jsx']
}
}