Skip to content

Instantly share code, notes, and snippets.

@arutnik
Created July 8, 2018 20:17
Show Gist options
  • Save arutnik/d01f90c46294c84c6c93c61357b306df to your computer and use it in GitHub Desktop.
Save arutnik/d01f90c46294c84c6c93c61357b306df to your computer and use it in GitHub Desktop.
SEO-SPA: Strip lib from Webpack
plugins: [
new webpack.NormalModuleReplacementPlugin(/jquery-funpicker/, // Adding this rule strips jquery-funpicker
path.join(__dirname, 'webpack/empty.json')), // out of the server bundle
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?angular(\\|\/)core(.+)?/,
path.join(__dirname, 'src'), // location of your src
{} // a map of your routes
),
new webpack.ContextReplacementPlugin(
// fixes WARNING Critical dependency: the request of a dependency is an expression
/(.+)?express(\\|\/)(.+)?/,
path.join(__dirname, 'src'),
{}
)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment