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

Add publicPath to webpack config #2455

Merged
merged 1 commit into from Jan 23, 2018
Merged

Conversation

alxlu
Copy link
Contributor

@alxlu alxlu commented Jan 21, 2018

Currently if you import a file that uses code splitting with Dynamic Imports (e.g. import("./path/to/file")):

dynamicImports.js

module.exports = import("./file1");

Index.re

[@bs.module] external dynamicComponents : Js.Promise.t(ReasonReact.reactClass) : "./dynamicImports"

it will look for it in the src directory (src/0.index.js) which causes it to fail when loading the chunk. Adding publicPath to the webpack config will let it resolve the file properly to build/0.index.js.

@bobzhang
Copy link
Member

would any one who is knowledgeable with webpack have a look?

Copy link
Contributor

@yawaramin yawaramin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a Webpack expert, but this does seem to make sense.

@bobzhang bobzhang merged commit 06cbd7f into rescript-lang:master Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants