using webpack proxying for api endpoint, serving static assets via webpack

This commit is contained in:
Malar Kannan
2017-07-29 23:16:40 +05:30
parent a26d63881b
commit 6c92ac627c
4 changed files with 14 additions and 14 deletions

View File

@@ -12,7 +12,7 @@ const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const WriteFilePlugin = require('write-file-webpack-plugin');
// const WriteFilePlugin = require('write-file-webpack-plugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
// Webpack uses `publicPath` to determine where the app is being served from.
@@ -282,7 +282,7 @@ module.exports = {
stripPrefix: paths.appBuild.replace(/\\/g, '/') + '/',
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new WriteFilePlugin()
// new WriteFilePlugin()
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.

View File

@@ -65,7 +65,7 @@ module.exports = function(proxy, allowedHost) {
// Reportedly, this avoids CPU overload on some systems.
// https://github.com/facebookincubator/create-react-app/issues/293
watchOptions: {
ignored: /node_modules/,
ignored: [/node_modules/,'public/png/*']
},
// Enable HTTPS if the HTTPS environment variable is set to 'true'
https: protocol === 'https',