-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
59 lines (57 loc) · 1.91 KB
/
webpack.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var ManifestPlugin = require('webpack-manifest-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
// the main entry of our app
entry: {
main: 'src/main.js',
},
// output configuration
output: {
path: path.resolve(__dirname, './public/build/'),
publicPath: './build/',
filename: '[name].js'
},
module: {
loaders: [
{ test: /\.vue$/, loader: 'vue' },
{ test: /\.js$/, loader: 'babel', exclude:[/node_modules/, /styles/] },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!resolve-url!sass-loader!') },
{ test: /\.(woff|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader'},
{ test:/\.(png|jpe?g|gif)$/,exclude:/node_modules/,loader: 'url-loader?limit=8192'}
],
noParse: /dist\/ol.js/,
},
resolve: {
root: path.resolve(__dirname, '/resources/assets/'),
moduleDirectories: path.resolve(__dirname, '/node_modules/'),
extensions: ['', '.js', '.vue', '.scss', '.sass'],
alias: {
vue: 'vue/dist/vue.js',
'styles': path.resolve(__dirname, './resources/assets/sass'),
'src': path.resolve(__dirname, './resources/assets/js'),
'pages': path.resolve(__dirname, './resources/assets/js/pages'),
'filters': path.resolve(__dirname, './resources/js/js/filters'),
'directives': path.resolve(__dirname, './resources/assets/js/directives'),
'components': path.resolve(__dirname, './resources/assets/js/components'),
},
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime']
},
plugins: [
new ExtractTextPlugin('[name].css', {
allChunks: true
}),
new webpack.optimize.CommonsChunkPlugin({
name: "commons",
filename: "commons.js",
}),
new ManifestPlugin({
fileName: 'rev-manifest.json'
}),
]
}