Skip to content
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

No starting slash '/' when using webpack 2 #635

Closed
laruiss opened this issue Apr 3, 2017 · 3 comments
Closed

No starting slash '/' when using webpack 2 #635

laruiss opened this issue Apr 3, 2017 · 3 comments

Comments

@laruiss
Copy link

laruiss commented Apr 3, 2017

Hello, I need this plugin, but when I use it in webpack 2, the generated script tag is of the form:

<script type="text/javascript" src="static/js/bundle.js"></script>

instead of:

<script type="text/javascript" src="/static/js/bundle.js"></script>

Note: with the same plugin options, it works as expected in Webpack 1.

Here are the relevant parts of webpack conf:

  entry: [
    paths.appIndexJs,
    publicPath,
  ],
  output: {
    pathinfo: true,
    path: paths.appBuild,
    filename: 'static/js/bundle.js',
  },

  // (...)

  plugins: [
    new HtmlWebpackPlugin({
      inject: true,
      template: paths.appHtml,
    }),

What am I doing wrong?

@laruiss
Copy link
Author

laruiss commented Apr 3, 2017

I added output.publicPath = '/' and it was OK, I think it would be nice to have this in the examples and/or doc...

@laruiss laruiss closed this as completed Apr 3, 2017
@zcoding
Copy link

zcoding commented Apr 26, 2017

so why i have to set output.publicPath: '/' ?

@lock
Copy link

lock bot commented May 31, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants