12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- 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: [
- './src/index.js'
- ],
- devtool: 'source-map',
- output: {
- path: path.join(__dirname, 'dist'),
- filename: 'bundle.js'
- },
- resolve: {
- extensions: ['', '.js', '.jsx'],
- alias: {
- 'react': 'preact-compat',
- 'react-dom': 'preact-compat',
- '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', 'autoprefixer?browsers=last 2 versions',
- "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"
- }
- ]
- },
- plugins: [
- new ExtractTextPlugin('bundle.css'),
- new HtmlWebpackPlugin({
- title : 'Rate-It',
- template : './template/index.ejs',
- inject: false
- }),
- new webpack.optimize.UglifyJsPlugin({
- compress: { warnings: false },
- comments: false,
- minimize: false,
- sourceMap : true
- }),
- new webpack.optimize.AggressiveMergingPlugin(),
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': '"production"'
- }),
- new FaviconsWebpackPlugin('./images/favicon.png')
- ]
- };
|