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

How can I make webpack compile all file in the packs folder #226

Closed
ankitrg opened this issue Apr 3, 2017 · 7 comments
Closed

How can I make webpack compile all file in the packs folder #226

ankitrg opened this issue Apr 3, 2017 · 7 comments

Comments

@ankitrg
Copy link

ankitrg commented Apr 3, 2017

Currently, only the top level files are compiled and not the files inside the sub folder. How can I make the watcher look for any of the files?

@ytbryan
Copy link
Contributor

ytbryan commented Apr 4, 2017

There is a PR for it #201

@ankitrg
Copy link
Author

ankitrg commented Apr 4, 2017

Will I be able to gracefully upgrade these new changes to my webpacker once the PR is merged?

@ytbryan
Copy link
Contributor

ytbryan commented Apr 4, 2017

Assuming you are using webpacker 1.1+, It's just modification to shared.js. Hence you will need to rerun rails webpacker:install

Alternatively, you can copy this commit (https://github.com/rails/webpacker/pull/201/files) to your shared.js and start using it.

@gauravtiwari
Copy link
Member

If you re-run installer later it will ignore the files if they are identical so, you can just add it as @ytbryan suggested and re-run installer whenever the gem gets updated.

@ytbryan
Copy link
Contributor

ytbryan commented Apr 5, 2017

The PR has been merged. Please consider closing this.

@ankitrg
Copy link
Author

ankitrg commented Apr 5, 2017

I get the following error when I replace the shared.js with the changes in the pr:

94% asset optimizationpath.js:7              
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)
    at ManifestPlugin.<anonymous> (/home/aks/playground/forme/node_modules/webpack-manifest-plugin/lib/plugin.js:108:29)
    at Compiler.applyPluginsAsyncSeries (/home/aks/playground/forme/node_modules/tapable/lib/Tapable.js:142:13)
    at Compiler.emitAssets (/home/aks/playground/forme/node_modules/webpack/lib/Compiler.js:303:7)
    at onCompiled (/home/aks/playground/forme/node_modules/webpack/lib/Compiler.js:54:18)
    at /home/aks/playground/forme/node_modules/webpack/lib/Compiler.js:494:13
    at next (/home/aks/playground/forme/node_modules/tapable/lib/Tapable.js:138:11)
    at Compiler.<anonymous> (/home/aks/playground/forme/node_modules/webpack/lib/CachePlugin.js:62:5)
    at Compiler.applyPluginsAsyncSeries (/home/aks/playground/forme/node_modules/tapable/lib/Tapable.js:142:13)
    at /home/aks/playground/forme/node_modules/webpack/lib/Compiler.js:491:10
    at Compilation.applyPluginsAsyncSeries (/home/aks/playground/forme/node_modules/tapable/lib/Tapable.js:131:46)
    at self.applyPluginsAsync.err (/home/aks/playground/forme/node_modules/webpack/lib/Compilation.js:645:19)
    at next (/home/aks/playground/forme/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.compilation.plugin (/home/aks/playground/forme/node_modules/webpack/lib/ProgressPlugin.js:121:6)
    at Compilation.applyPluginsAsyncSeries (/home/aks/playground/forme/node_modules/tapable/lib/Tapable.js:142:13)

@gauravtiwari
Copy link
Member

gauravtiwari commented Apr 6, 2017

@ankitrg Please close this issue, this feature is in master now. You have to re-run bundle exec rails webpacker:install to replace your current shared.js

@ankitrg ankitrg closed this as completed Apr 6, 2017
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

3 participants