Guest User

Untitled

a guest
Nov 14th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. var webpack = require( 'webpack' );
  3.  
  4. module.exports = {
  5.     devtool: 'sourcemap' ,
  6.     entry: {
  7.         'app': [ './build/frontend/index.js' ] ,
  8.     } ,
  9.     output: {
  10.         path: __dirname + '/../bin/frontend' ,
  11.         filename: "js/[name].js"
  12.     } ,
  13.     resolve: {
  14.         modules: [
  15.             'node_modules' ,
  16.             __dirname + '/../config' ,
  17.             __dirname + '/../build' ,
  18.             __dirname + '/../resource' ,
  19.         ] ,
  20.         extensions: [ '.js' ]
  21.     } ,
  22.     devServer: {
  23.         contentBase: __dirname + '/../bin/frontend/' ,
  24.         historyApiFallback: true ,
  25.         hot: true ,
  26.         inline: true ,
  27.         progress: true ,
  28.         stats: 'errors-only' ,
  29.         port: 8081 ,
  30.         proxy: {
  31.             '/api': {
  32.                 target: 'http://localhost:8900/' ,
  33.                 secure: false ,
  34.                 bypass: function( req , res , proxyOptions ) {
  35.                     if ( req.path.indexOf( '.html' ) !== -1 || req.path.indexOf( '.js' ) !== -1 ) {
  36.                         return req.path;
  37.                     }
  38.                 } ,
  39.             } ,
  40.         } ,
  41.     } ,
  42.     module: {
  43.         rules: [
  44.             {
  45.                 test: /\.html$/ ,
  46.                 exclude: /(node_modules|bower_components)/ ,
  47.                 loaders: [ 'text-loader' ] ,
  48.             } ,
  49.             {
  50.                 test: /\.json$/ ,
  51.                 exclude: /(node_modules|bower_components)/ ,
  52.                 loaders: [ 'json-loader' ] ,
  53.             } ,
  54.             {
  55.                 test: /\.scss$/ ,
  56.                 loaders: [ "style-loader" , "css-loader?-url" , "sass-loader" ]
  57.             } ,
  58.             {
  59.                 test: /\.css$/ ,
  60.                 loaders: [ 'style-loader' , 'css-loader' ] ,
  61.             } ,
  62.             { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=application/font-woff&name=./build/[hash].[ext]" } ,
  63.             { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=application/font-woff&name=./build/[hash].[ext]" } ,
  64.             { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=application/octet-stream&name=./build/[hash].[ext]" } ,
  65.             { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/ , loader: "file?name=./build/[hash].[ext]" } ,
  66.             { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=image/svg+xml&name=./build/[hash].[ext]" } ,
  67.             { test: /\.png$/ , loader: 'file?name=./build/[hash].[ext]' } ,
  68.             { test: /\.jpg$/ , loader: 'file?name=./build/[hash].[ext]' } ,
  69.             { test: /\.gif$/ , loader: 'file?name=./build/[hash].[ext]' } ,
  70.         ] ,
  71.     } ,
  72.     plugins: [
  73.         new webpack.HotModuleReplacementPlugin() ,
  74.     ] ,
  75. };
Advertisement
Add Comment
Please, Sign In to add comment