| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- const webpack = require('webpack')
- const path = require('path')
- var ExtractTextPlugin = require('extract-text-webpack-plugin')
-
- const config = {
- entry: [
- './src/index.js',
- ],
- output: {
- path: path.resolve(__dirname, 'dist'),
- publicPath: '/',
- filename: 'bundle.js'
- },
- module: {
- loaders: [
- {
- test: /\.jsx?$/,
- exclude: /node_modules/,
- loader: 'react-hot-loader!babel-loader'
- },
- {
- test: /\.s?css$/,
- loader: ExtractTextPlugin.extract({
- fallback: 'style-loader',
- use: ['css-loader', 'sass-loader']
- })
- },
- {
- test: /\.(eot|svg|ttf|woff|woff2)$/,
- loader: 'file-loader?name=fonts/[name].[ext]'
- }
- ]
- },
- resolve: {
- extensions: ['*', '.js', '.jsx'],
- alias: {
- Components: path.resolve(__dirname, 'src', 'Shared', 'Components')
- }
- },
- plugins: [
- new ExtractTextPlugin({ filename: 'style.css', allChunks: true }),
- new webpack.DefinePlugin({
- ENV: JSON.stringify(process.env.NODE_ENV || 'developpement')
- }),
- ],
- devServer: {
- contentBase: './dist',
- hot: true,
- historyApiFallback: true
- },
- }
-
- if (process.env.NODE_ENV !== 'production')
- config.entry.push(
- 'webpack-dev-server/client?http://localhost:8080',
- 'webpack/hot/only-dev-server'
- );
-
- module.exports = config
|