forked from glorious-codes/glorious-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.conf.base.js
36 lines (35 loc) · 899 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
const ExtractTextPlugin = require('extract-text-webpack-plugin'),
project = require('./project.json'),path= require('path');
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}`
}
}
};