-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.demo.config.js
41 lines (41 loc) · 1.62 KB
/
webpack.demo.config.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
const path = require("path");
const webpack = require("webpack");
// const autoprefixer = require("autoprefixer");
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
'demo': './demo/demo.js'
},
output: {
publicPath: '/dist/',
path: path.resolve(__dirname, './dist'),
filename: '[name].min.js'
},
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
css: ExtractTextPlugin.extract({
loader: 'css-loader',
fallbackLoader: 'vue-style-loader' // <- this is a dep of vue-loader, so no need to explicitly install if using npm3
}),
// Since sass-loader (weirdly) has SCSS as its default parse mode, we map
// the "scss" and "sass" values for the lang attribute to the right configs here.
// other preprocessors should work out of the box, no loader config like this nessessary.
// 'scss': 'vue-style-loader!css-loader!sass-loader',
// 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax'
}
}
}, { test: /\.(js|jsx)$/, use: 'babel-loader' }, {
test: /\.css/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader?-url!postcss-loader?'
})
}, ]
},
devtool: 'cheap-source-map',
plugins: [new ExtractTextPlugin('demo.css')],
};