-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
executable file
·59 lines (54 loc) · 1.46 KB
/
Copy pathwebpack.dev.js
File metadata and controls
executable file
·59 lines (54 loc) · 1.46 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
const path = require('path');
const { merge } = require('webpack-merge');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ScriptingWebpackPlugin = require('scripting-webpack-plugin')
const BaseConfiguration = require('./webpack.base.js');
module.exports = (env) => {
const browser = env?.browser || 'chrome';
const buildTarget = 'dev'
const outputPath = path.resolve(__dirname, 'dev', browser)
const DevelopmentConfiguration = {
mode: 'development',
devtool: 'inline-source-map',
stats: {
errorDetails: true
},
entry: {
...BaseConfiguration.entry,
devutils: path.resolve(__dirname, 'src', 'DevUtils', 'devutils.js')
},
output: {
...BaseConfiguration.output,
path: outputPath,
},
plugins: [
...BaseConfiguration.plugins,
new CopyWebpackPlugin({
patterns: [{
from: path.resolve(__dirname, 'src', 'Assets'),
to: outputPath
}]
}),
new ScriptingWebpackPlugin({
scripts: {
onAfterEmit: [{
script: './scripts/build/webpack/mv-manifest.sh',
args: [ browser, buildTarget ]
},{
script: './scripts/build/webpack/tailwindcss.sh',
args: [ browser ]
}]
},
shell: 'bash',
verbose: true
})
],
resolve: {
alias: {
...BaseConfiguration.resolve.alias,
'@dev': path.resolve(__dirname, 'src', 'DevUtils')
}
}
}
return merge(BaseConfiguration, DevelopmentConfiguration);
};