-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
26 lines (24 loc) · 825 Bytes
/
webpack.config.js
File metadata and controls
26 lines (24 loc) · 825 Bytes
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
//Note: ESM (ES6 modules, i.e. import/export) in config requires using "--config-register esm" param for webpack
import path from 'path'
import pj2us from 'pj2us-transformer';
import CopyWebpackPlugin from 'copy-webpack-plugin'
import { CleanWebpackPlugin } from 'clean-webpack-plugin'
const defaultConf = {
name: 'default',
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin([ {
from: 'package.json',
to: path.resolve(__dirname, 'dist') + '/local.user.js',
transform: function(content, resourcePath) {
return pj2us(content, path.resolve(__dirname, 'dist/main.js'));
}
} ], { })
]
}
export default defaultConf