1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-15 06:32:34 +01:00
flox/client/webpack.config.js
Viktor Geringer a50a7d7c5b change settings page (#31)
* prepare languages

* prepare routes

* split settings into smaller components

* move debounce and vue-router into vendor

* remove dependency from index

* refactor

* update method comment
2017-02-13 21:17:33 +01:00

70 lines
1.5 KiB
JavaScript

const webpack = require('webpack');
const path = require('path');
const autoprefixer = require('autoprefixer');
const lost = require('lost');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
app: './app/app.js',
vendor: ['vue', 'axios', 'vuex', 'debounce', 'vue-router']
},
output: {
path: path.resolve('../public/assets'),
filename: 'app.js'
},
resolve: {
alias: {
vue$: 'vue/dist/vue.common'
}
},
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.(png|jpg|svg)$/,
loader: 'url',
query: {
limit: 10000,
name: 'img/[name].[ext]',
emitFile: false
}
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', 'css!postcss!sass')
}
]
},
postcss() {
return [autoprefixer, lost];
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new ExtractTextPlugin('app.css')
]
};
if(process.env.NODE_ENV === 'production') {
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
])
}