using webpack proxying for api endpoint, serving static assets via webpack
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user