-
-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
- Webpack Version: 4.29.0
- Operating System (or Browser): macOS Mojave
- Node Version: 10.13.0
- webpack-plugin-serve Version: 0.4.0
How Do We Reproduce?
Standard webpack build, the following configuration:
plugs.push(new Serve({
hmr: true,
historyFallback: true,
open: true,
port: 9000,
status: true,
middleware: (app, builtins) => {
const koaStaticOpts = {
extensions: ['.html', '.htm']
};
builtins.static([path.join(ROOT_DIR, 'stub'), path.join(ROOT_DIR, 'dist')], koaStaticOpts)
}
}));
then I run my build command from package.json:
cross-env npx wp --mode production --site SITENAME --progress
// side-note: the --progress flag doesn't work either but that's not what i'm reporting here
Expected Behavior
the production build to be free of all references to/code around WPS or any variables output by it gracefully handled to prevent ReferenceErrors.
I tried hiding the "plugs.push" call behind a "if production" flag but was receiving a webpack_hash is undefined error. Upon removing that I got the error I am now seeing.
Actual Behavior
It would seem that WPS is being included in the production bundle. It also looks like, despite the production flag being set, that React Hot Loader is also still being looked for/called (see screenshot). Not sure what's going on but it was my understanding that React Hot Loader and WPS no-op altogether when built to production.
Reactions are currently unavailable
