运行webpack hello.js hello.bundle.js --module-bind 'css=style-loader!css-loader'

来源:1-2 Webpack 安装和命令行

信缘佛

2017-02-17 10:36

ERROR in ./style.css

Module parse failed: E:\webpack_test\style.css Unexpected token (1:9)

You may need an appropriate loader to handle this file type.

SyntaxError: Unexpected token (1:9)

    at Parser.pp$4.raise (E:\webpack_test\node_modules\acorn\dist\acorn.js:2221:

15)

    at Parser.pp.unexpected (E:\webpack_test\node_modules\acorn\dist\acorn.js:60

3:10)

    at Parser.pp.semicolon (E:\webpack_test\node_modules\acorn\dist\acorn.js:581

:61)

    at Parser.pp$1.parseExpressionStatement (E:\webpack_test\node_modules\acorn\

dist\acorn.js:966:10)

    at Parser.pp$1.parseStatement (E:\webpack_test\node_modules\acorn\dist\acorn

.js:730:24)

    at Parser.pp$1.parseTopLevel (E:\webpack_test\node_modules\acorn\dist\acorn.

js:638:25)

    at Parser.parse (E:\webpack_test\node_modules\acorn\dist\acorn.js:516:17)

    at Object.parse (E:\webpack_test\node_modules\acorn\dist\acorn.js:3098:39)

    at Parser.parse (E:\webpack_test\node_modules\webpack\lib\Parser.js:902:15)

    at DependenciesBlock.<anonymous> (E:\webpack_test\node_modules\webpack\lib\N

ormalModule.js:104:16)

    at DependenciesBlock.onModuleBuild (E:\webpack_test\node_modules\webpack-cor

e\lib\NormalModuleMixin.js:310:10)

    at nextLoader (E:\webpack_test\node_modules\webpack-core\lib\NormalModuleMix

in.js:275:25)

    at E:\webpack_test\node_modules\webpack-core\lib\NormalModuleMixin.js:259:5

    at Storage.finished (E:\webpack_test\node_modules\enhanced-resolve\lib\Cache

dInputFileSystem.js:38:16)

    at E:\webpack_test\node_modules\graceful-fs\graceful-fs.js:78:16

    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)

 @ ./hello.js 1:0-22


写回答 关注

2回答

  • 赵成冬
    2017-03-19 12:43:36

    楼下要以看下这篇文章http://blog.csdn.net/luo6620378xu/article/details/9081417

    慕粉3690...

    404,找不到页面

    2019-02-14 21:05:28

    共 1 条回复 >

  • jghkjkl_123
    2017-02-17 11:38:09

    webpack hello.js hello.bundle.js --module-bind "css=style-loader!css-loader"    把单引号改成双引号 就可以 

    慕粉3690...

    真的可以哎!这到底是为什么啊

    2019-02-14 21:06:21

    共 6 条回复 >

webpack深入与实战

webpack实战教程,用真实项目带你探索 webpack 强大的功能

86561 学习 · 721 问题

查看课程

相似问题