This repository has been archived on 2020-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
victor-hugo/webpack.conf.js

50 lines
1.1 KiB
JavaScript

import webpack from 'webpack';
import path from 'path';
export default {
module: {
loaders: [
{
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file?name=/[hash].[ext]'
},
{ test: /\.json$/, loader: 'json-loader' },
{
test: /\.css$/,
loader: 'style!css?modules!postcss'
},
{
loader: 'babel',
test: /\.js?$/,
exclude: /node_modules/,
query: {
cacheDirectory: true,
presets: ['react', 'es2015'],
plugins: ['transform-class-properties', 'transform-object-assign', 'transform-object-rest-spread']
}
}
]
},
postcss: [
require('postcss-cssnext')
],
plugins: [
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
],
context: path.join(__dirname, 'src'),
entry: {
app: ['./js/app'],
},
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/',
filename: '[name].js'
},
externals: [/^vendor\/.+\.js$/]
};