1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 22:22:39 +01:00
flox/client/webpack.config.js
Viktor Geringer 1a1753181f
move genres into own table (#104)
* create genres table and translate media_type

* parse genres from TMDb and modify artisan db command

* parse genres on migration

* Save genres in new table (via relation)

* Implode genres as string.
Update genres in refresh.

* add tests for genres

* fix icon for src

* display genres on own page

include few ui tweaks
2018-03-11 21:08:44 +01:00

73 lines
1.5 KiB
JavaScript

const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
app: './app/app.js',
vendor: ['vue', 'axios', 'vuex', 'debounce', 'vue-router']
},
watchOptions: {
poll: true
},
output: {
path: path.resolve('../public/assets'),
filename: 'app.js'
},
resolve: {
alias: {
vue$: 'vue/dist/vue.common'
}
},
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|svg|woff|woff2|eot|ttf)$/,
use: {
loader: 'url-loader',
options: {
limit: 10000,
name: 'img/[name].[ext]',
emitFile: false
}
}
},
{
test: /\.(scss|css)$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader', 'sass-loader']
})
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({name: 'vendor', filename: '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
}
})
])
}