| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- const webpack = require('webpack');
- var ExtractTextPlugin = require('extract-text-webpack-plugin')
-
- const config = {
- entry: [
- './src/index.js',
- ],
- output: {
- path: __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']
- },
- plugins: [
- new ExtractTextPlugin({ filename: 'style.css', allChunks: true }),
- new webpack.DefinePlugin({
- ENV: "'test'"
- }),
- ],
- 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
|