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