1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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');
- module.exports = {
- entry: [
- //'webpack-dev-server/client?http://localhost:3000',
- //'webpack/hot/dev-server',
- //'./i18nliner.js',
- './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']
- }, {
- 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')
- })
- ]
- };
|