var webpack = require('webpack'); var path = require('path'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var FaviconsWebpackPlugin = require('favicons-webpack-plugin'); var TranslationPlugin = require('extract-translation-keys-webpack'); module.exports = { entry: [ './src/index.js' ], devtool: 'eval', output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js' }, resolve: { extensions: ['', '.js', '.jsx', '.css'], modules: ['node_modules', 'src'], alias : { 'flags.css' : path.join(__dirname, 'node_modules/flag-icon-css/css/flag-icon.min.css') } }, module: { loaders: [{ test: /\.jsx?$/, exclude: /(node_modules)/, loaders: ['babel', TranslationPlugin.loader({ path :path.join(__dirname, "config/locales/generated") })] }, { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') }, { test: /\.scss$/, loaders: ['style', 'css', 'postcss-loader', "sass?outputStyle=expanded&" ] },{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" }, { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" }, { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }, { test: /\.gif/, loader: "url-loader?limit=10000&mimetype=image/gif" }, { test: /\.jpg/, loader: "url-loader?limit=10000&mimetype=image/jpg" }, { test: /\.png/, loader: "url-loader?limit=10000&mimetype=image/png" },{ test : /\.json/, loader: "json-loader" } ] }, devServer: { contentBase: "./dist", hot: true, inline: true, port: 3000, historyApiFallback: true }, plugins: [ new webpack.NoErrorsPlugin(), new webpack.HotModuleReplacementPlugin(), new ExtractTextPlugin('bundle.css'), new HtmlWebpackPlugin({ title : 'Rate-It', template : './template/index.ejs', inject: false }), new FaviconsWebpackPlugin('./images/favicon.png'), new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development') }), new TranslationPlugin({ path : path.join(__dirname, "config/locales/generated"), output : path.join(__dirname, "config/locales"), lang : "en" }) ] };