diff options
Diffstat (limited to 'webpack.conf.js')
| -rw-r--r-- | webpack.conf.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/webpack.conf.js b/webpack.conf.js new file mode 100644 index 0000000..a0e014b --- /dev/null +++ b/webpack.conf.js @@ -0,0 +1,49 @@ +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$/] +}; |
