forked from glorious-codes/glorious-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.conf.base.js
37 lines (36 loc) · 902 Bytes
/
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
const path= require('path'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
project = require('./project.json');
module.exports = {
entry: `${__dirname}/${project.scripts.source.entry}`,
output: {
library: 'GDemo',
libraryTarget: 'umd',
path: `${__dirname}/${project.scripts.dist.root}`
},
module: {
rules: [{
test: /\.(styl|css)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{loader: 'css-loader', options: {minimize: true}},
'stylus-loader'
]
})
}, {
test: /\.html$/,
include: [path.resolve(__dirname,project.scripts.source.root)],
use: 'html-loader'
}, {
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader'
}]
},
resolve: {
alias: {
'@styles': `${__dirname}/${project.styles.source.root}`
}
}
};