[关闭]
@jeffjade 2016-04-06T10:47:44.000000Z 字数 821 阅读 1529

Gulp+Webpack+Vue

Gulp Vue


npm 模块安装机制简介.

This repo is a collection of simple demos of Webpack[By阮一峰].
https://github.com/ruanyf/webpack-demos

Webpack插件路径修改

  1. resolveLoader: {
  2. root: path.join(__dirname, "node_modules")
  3. },
  4. resolve: {
  5. root: path.join(__dirname, "node_modules"),
  6. modulesDirectories: ['node_modules'],
  7. // Allow to omit extensions when requiring these files
  8. extensions: ["", ".js", ".jsx"]
  9. }

Vue样式文件修改注意事项

书写vue样式文件中url路径后不能添加与无关的东西,。比如下代码:

  1. .drawbox {
  2. width: 87%;
  3. height: 99%;
  4. position: absolute;
  5. right: 6%;
  6. bottom: 13.5%;
  7. background: url(./../assets/rotary.png);
  8. /*background: url(./../assets/rotary.png?v1)无法解析*/
  9. background-size: 100% 100%;
  10. }

无法解析,编译时会报错如下:

ERROR in ./assets/rotary.png?v1
Module parse failed: E:\xxx\assets\rotary.png?v1 Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)

30分钟手把手教你学webpack实战
WebPack 常用功能介绍

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注