-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.conf.base.js
68 lines (67 loc) · 1.66 KB
/
webpack.conf.base.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
58
59
60
61
62
63
64
65
66
67
68
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const project = require('./project.json');
module.exports = {
entry: [`${__dirname}/${project.scripts.webapp.source.index}`],
externals: {
'angular': 'angular',
'@babel/standalone': 'Babel',
'react': 'React',
'react-dom': 'ReactDOM',
'vue': 'Vue'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|external)/,
use: 'babel-loader'
},
{
test: /\.html$/,
include: [`${__dirname}/${project.scripts.webapp.source.root}`],
use: 'html-loader'
},
{
test: /\.(styl|css)$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: { url: false }
},
'stylus-loader'
]
}
]
},
resolve: {
alias: {
'@cli': `${__dirname}/${project.scripts.cli.source.root}`,
'@data': `${__dirname}/${project.data.source.root}`,
'@scripts': `${__dirname}/${project.scripts.webapp.source.root}`,
'@styles': `${__dirname}/${project.styles.source.root}`
}
},
plugins: [
new HtmlWebpackPlugin({
template: project.index.source.file,
cache: false,
minify: {
collapseWhitespace: true
}
}),
new CopyWebpackPlugin({
patterns: [
{
from: project.images.source.files,
to: project.images.dist.root
}
]
})
],
context: path.resolve(__dirname),
stats: 'none'
}