Skip to content

sourceMappingURL broken when using URL in publicPath #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gzzo opened this issue Jul 22, 2019 · 0 comments · May be fixed by #68
Open

sourceMappingURL broken when using URL in publicPath #67

gzzo opened this issue Jul 22, 2019 · 0 comments · May be fixed by #68
Labels

Comments

@gzzo
Copy link

gzzo commented Jul 22, 2019

Example webpack configuration:

import path from 'path'
import webpack from 'webpack'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import InlineSourcePlugin from 'html-webpack-inline-source-plugin'

export default {
  context: path.resolve(__dirname, 'src'),

  entry: ['./index.js'],

  devtool: 'source-map',

  output: {
    publicPath: `https://my.cdn.com`,
    filename: '[name].[contenthash].js',
    path: path.resolve(__dirname, 'dist'),
  },

  optimization: {
    runtimeChunk: 'single',
    splitChunks: {
      cacheGroups: {
        vendors: false,
        vendor: {
          name: 'vendor',
          chunks: 'initial',
          test: /node_modules/,
          priority: 20,
        },
      },
    },
  },

  plugins: [
    new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
    new HtmlWebpackPlugin({
      inlineSource: 'runtime.+\\.js',
    }),
    new InlineSourcePlugin(),
  ],

  resolve: {
    extensions: ['.js', '.jsx', '.scss'],
    modules: [
      path.resolve(__dirname, 'src'),
    ],
  },
}

Output index.html:

...
//# sourceMappingURL=https:/my.cdn.com/runtime.9a39f8dda0e7ff95bb67.js.map</script>

Note the single slash after https:

gzzo added a commit to gzzo/html-webpack-inline-source-plugin that referenced this issue Jul 22, 2019
@gzzo gzzo linked a pull request Jul 22, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants