Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var webpack = require( 'webpack' );
- module.exports = {
- devtool: 'sourcemap' ,
- entry: {
- 'app': [ './build/frontend/index.js' ] ,
- } ,
- output: {
- path: __dirname + '/../bin/frontend' ,
- filename: "js/[name].js"
- } ,
- resolve: {
- modules: [
- 'node_modules' ,
- __dirname + '/../config' ,
- __dirname + '/../build' ,
- __dirname + '/../resource' ,
- ] ,
- extensions: [ '.js' ]
- } ,
- devServer: {
- contentBase: __dirname + '/../bin/frontend/' ,
- historyApiFallback: true ,
- hot: true ,
- inline: true ,
- progress: true ,
- stats: 'errors-only' ,
- port: 8081 ,
- proxy: {
- '/api': {
- target: 'http://localhost:8900/' ,
- secure: false ,
- bypass: function( req , res , proxyOptions ) {
- if ( req.path.indexOf( '.html' ) !== -1 || req.path.indexOf( '.js' ) !== -1 ) {
- return req.path;
- }
- } ,
- } ,
- } ,
- } ,
- module: {
- rules: [
- {
- test: /\.html$/ ,
- exclude: /(node_modules|bower_components)/ ,
- loaders: [ 'text-loader' ] ,
- } ,
- {
- test: /\.json$/ ,
- exclude: /(node_modules|bower_components)/ ,
- loaders: [ 'json-loader' ] ,
- } ,
- {
- test: /\.scss$/ ,
- loaders: [ "style-loader" , "css-loader?-url" , "sass-loader" ]
- } ,
- {
- test: /\.css$/ ,
- loaders: [ 'style-loader' , 'css-loader' ] ,
- } ,
- { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=application/font-woff&name=./build/[hash].[ext]" } ,
- { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=application/font-woff&name=./build/[hash].[ext]" } ,
- { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=application/octet-stream&name=./build/[hash].[ext]" } ,
- { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/ , loader: "file?name=./build/[hash].[ext]" } ,
- { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/ , loader: "url?limit=10000&mimetype=image/svg+xml&name=./build/[hash].[ext]" } ,
- { test: /\.png$/ , loader: 'file?name=./build/[hash].[ext]' } ,
- { test: /\.jpg$/ , loader: 'file?name=./build/[hash].[ext]' } ,
- { test: /\.gif$/ , loader: 'file?name=./build/[hash].[ext]' } ,
- ] ,
- } ,
- plugins: [
- new webpack.HotModuleReplacementPlugin() ,
- ] ,
- };
Advertisement
Add Comment
Please, Sign In to add comment