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

does not write webpack-assets.json to location specified as rootDir #30

Closed
bdefore opened this issue Nov 22, 2015 · 9 comments
Closed

Comments

@bdefore
Copy link

bdefore commented Nov 22, 2015

Following the example here: https://github.com/erikras/react-redux-universal-hot-example/blob/master/bin/server.js#L4 I'm attempting to change rootDir to another path, in order to better externalize my source from the boilerplate code. For example, I'd like to change that to var rootDir = path.resolve(__dirname, '../external'); I also then update the context to point to the same path, so that the tools can find the webpack-assets.json.

Unfortunately, what I see is that it is writing the file into the project root, rather than what I'm specifying.

If I add logs to here: https://github.com/halt-hammerzeit/webpack-isomorphic-tools/blob/master/source/index.js#L149

        console.log('setting up project path', this.options.project_path);
        console.log('setting up webpack assets path', this.webpack_assets_path);

I get the following output:

[1] setting up project path /Users/d4/code/react-redux-universal-hot-example-fork/external
[1] setting up webpack assets path /Users/d4/code/react-redux-universal-hot-example-fork/external/webpack-assets.json

But then webpack-assets.json is written to the project root and it never finds them, so I see endless logs like the following:

[1] [webpack-isomorphic-tools] (waiting for the first Webpack build to finish)

I'm running version 2.2.18

@catamphetamine
Copy link
Owner

webpack-assets.json is written by Webpack plugin therefore rootDir doesn't take effect because rootDir variable is used only in your server code.
Does this answer your question?

@bdefore
Copy link
Author

bdefore commented Nov 22, 2015

how would i configure where that gets written to?

@catamphetamine
Copy link
Owner

you can use the configuration:
https://github.com/halt-hammerzeit/webpack-isomorphic-tools#configuration
webpack_assets_file_path

@bdefore
Copy link
Author

bdefore commented Nov 22, 2015

thanks. i got it to work by specifying webpack_assets_file_path: 'external/webpack-assets.json', in that configuration.

a note though: at that link it says in your comments above that it would default to writing webpack-assets.json the webpack configuration context, which i am setting to my external directory, so i would have expected this change to be unnecessary.

@catamphetamine
Copy link
Owner

a note though: at that link it says in your comments above that it would default to writing webpack-assets.json the webpack configuration context, which i am setting to my external directory, so i would have expected this change to be unnecessary.

Well, it did create webpack-assets.json in your webpack configuration context folder, or didn't it?

@bdefore
Copy link
Author

bdefore commented Nov 22, 2015

without the additional configuration change to webpack_assets_file_path it did not, it would write webpack-assets.json to the project root even though Webpack context was configured to external

@catamphetamine
Copy link
Owner

can you post your webpack.config.js?

@bdefore
Copy link
Author

bdefore commented Nov 22, 2015

@catamphetamine
Copy link
Owner

ok

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

No branches or pull requests

2 participants