-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathconfigure-static-assets.js
47 lines (42 loc) · 981 Bytes
/
configure-static-assets.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
'use strict'
// libraries
const path = require('path')
// Webpack plugins
const CopyWebpackPlugin = require('copy-webpack-plugin')
// Additional imports
const cli = require('../utils/cli')
// define your stuff
const baseDir = path.join(__dirname, '../../')
const buildDir = path.join(baseDir, 'build')
const PLUGINS = [
new CopyWebpackPlugin([{
from: path.join(baseDir, 'src', 'static'),
to: path.join(buildDir, 'assets', 'static'),
}])
]
cli.info('load app config from ./devel/webpack/configure-static-assets.js')
module.exports = {
name: 'static project assets',
mode: 'production',
entry: './src/static/index.js',
output: {
path: path.join(buildDir, 'assets', 'static'),
filename: 'index.js',
},
plugins: PLUGINS,
module: {
rules: [{
test: /\.html$/,
use: {
loader: 'html-loader'
}
},
{
test: /\.json$/,
use: {
loader: 'json-loader'
}
}
]
}
}