-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.babel.js
66 lines (63 loc) · 1.75 KB
/
webpack.config.babel.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
'use strict';
const webpack = require('webpack');
const path = require('path');
const ExtractText = require('extract-text-webpack-plugin');
const cssnext = require('postcss-cssnext');
const config = {
entry: {
main: path.join(__dirname, 'assets/js/main.js'),
login: path.join(__dirname, 'assets/js/login.js')
},
output: {
filename: path.join(__dirname, 'public/js/[name].js')
},
plugins: [
new ExtractText(path.join(__dirname, 'public/css/style.css')),
new webpack.OldWatchingPlugin()
],
devtool: 'eval-source-map',
module: {
loaders: [{
test: /\.vue$/,
exclude: /node_modules/,
loader: 'vue'
}, {
test: /\.json$/,
exclude: /node_modules/,
loader: 'json'
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-3'],
plugins: ['transform-object-rest-spread']
},
}, {
test: /\.scss$/,
loader: ExtractText.extract('style', 'css?sourceMap!postcss!sass?sourceMap')
}, {
test: /\.(woff(2)?|ttf|eot)$/,
loader: 'url-loader?name=public/fonts/[name].[ext]'
}, {
test: /\.svg/,
loader: 'raw-loader'
}]
},
vue: {
loaders: {
css: ExtractText.extract('css'),
sass: ExtractText.extract('css!sass')
}
},
postcss: function() {
return [cssnext];
},
resolve: {
alias: {
config: path.join(__dirname, 'assets/js/config.js'),
'vue$': 'vue/dist/vue.common.js'
}
}
};
module.exports = config;