Skip to content

Commit

Permalink
add publicPath option to webpack config to update the public path of …
Browse files Browse the repository at this point in the history
…the lazy loaded js files at build time
  • Loading branch information
poojagunturu96 committed Dec 15, 2023
1 parent 19a0fc7 commit 0827cf3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import webpack from 'webpack';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';

const PROD = process.env.NODE_ENV === 'production';

// const BundleAnalyzerPlugin =
// require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const ASSET_PATH = process.env.ASSET_PATH || '/js/';

const plugins = [
// ignore moment imported by pikaday
Expand Down Expand Up @@ -43,6 +41,7 @@ const config = {
extensions: ['.tsx', '.ts', '.js']
},
output: {
publicPath: ASSET_PATH,
filename: '[name].bundle.js'
},
plugins: PROD ? plugins : [...plugins, new BundleAnalyzerPlugin()]
Expand Down

0 comments on commit 0827cf3

Please sign in to comment.