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

模块中require css失败 #3

Open
wzsxyz opened this issue Nov 17, 2015 · 3 comments
Open

模块中require css失败 #3

wzsxyz opened this issue Nov 17, 2015 · 3 comments

Comments

@wzsxyz
Copy link

wzsxyz commented Nov 17, 2015

在src目录下的js中require加载css无问题,但在node_modules目录下的模块中有require加载css就异常了:Module not found: Error: Cannot resolve 'file' or 'directory' ...
是webpack本身问题还是dbl做的配置问题?

@wzsxyz
Copy link
Author

wzsxyz commented Nov 17, 2015

自己改好了,配置文件中这样改就行了
resolve: {
root: [srcDir, path.resolve(process.cwd(), './node_modules')], // 原来是root: [srcDir, './node_modules']
alias: sourceMap,
extensions: ['', '.js', '.css', '.scss', '.tpl', '.png', '.jpg']
},

@wzsxyz wzsxyz closed this as completed Nov 17, 2015
@wzsxyz
Copy link
Author

wzsxyz commented Nov 17, 2015

已自己解决了,见回复

@wzsxyz wzsxyz reopened this Nov 17, 2015
@cc17
Copy link
Owner

cc17 commented Nov 17, 2015

太感谢了 我加入到里面去

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