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 to chain with script-loader? #2

Closed
DanielApt opened this issue Feb 6, 2015 · 2 comments
Closed

How to chain with script-loader? #2

DanielApt opened this issue Feb 6, 2015 · 2 comments

Comments

@DanielApt
Copy link

I'd like to use uglify-loader to uglify files required with the script-loader.

My code looks as follows:

require('uglify-loader');
require('uglify!script!../lib/form2js/form2js');

When doing this I get the following error:

Module not found: Error: Cannot resolve module 'fs'
in ~/project/node_modules/uglify-loader/node_modules/uglify-js/tools
 @ ./~/uglify-loader/~/uglify-js/tools/node.js 2:9-22
@bestander
Copy link
Owner

Why do you require require('uglify-loader');?
Webpack plugins should work without explicit require.

I just have checked it on my local setup:

[169] ./~/uglify-loader!./~/script-loader!./components/angular/angular.min.js 386 {0} [built]
[170] ./~/raw-loader!./components/angular/angular.min.js 128453 {0} [built]

All looks fine to me.

This Cannot resolve module 'fs' is familiar, have a look at
webpack/webpack#451
pugjs/pug-loader#8

@bestander
Copy link
Owner

reopen issue if it is still relevant

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