Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用网页包模板在Vue 2项目中应用手写笔插件_Javascript_Webpack_Vuejs2_Stylus - Fatal编程技术网

Javascript 如何使用网页包模板在Vue 2项目中应用手写笔插件

Javascript 如何使用网页包模板在Vue 2项目中应用手写笔插件,javascript,webpack,vuejs2,stylus,Javascript,Webpack,Vuejs2,Stylus,我有一个Vue2项目,我正在使用它作为CSS预处理器(手写笔、手写笔加载程序已经安装并运行) 我找不到一种方法来应用类似手写笔的插件 我试图修改触笔加载程序的build/utils.js中的选项,如下所示: stylus: generateLoaders('stylus', {use: [require('rupture')()]}), styl: generateLoaders('stylus', {use: [require('rupture')()]}) 还尝试从App.vue中的标记导

我有一个Vue2项目,我正在使用它作为CSS预处理器(手写笔、手写笔加载程序已经安装并运行)

我找不到一种方法来应用类似手写笔的插件

我试图修改触笔加载程序的
build/utils.js
中的选项,如下所示:

stylus: generateLoaders('stylus', {use: [require('rupture')()]}),
styl: generateLoaders('stylus', {use: [require('rupture')()]})
还尝试从
App.vue
中的
标记导入
,如:

@import 'rupture/rupture/index.styl' // also 'rupture/index.styl'
还尝试从
main.js
导入它,但到目前为止没有任何效果


提前谢谢

嗯,我想出了一个解决方案,它利用了触笔的
import
选项,如下所示:

stylus: generateLoaders('stylus', {

  // unfortunately `use` option throws error
  // use: [require('nib')(), require('rupture')()]

  // import to the rescue
  import: [
    '~nib/index.styl',
    '~rupture/rupture/index.styl',
    path.resolve(__dirname, '../src/styles/cfg.styl')
  ]
}),

注意:如果
导入
选项中提供的任何路径不正确,服务器会自动进入挂起状态,并且不会启动-不会抛出错误。

好吧,我想出了一个解决方案,它利用了触笔的
导入
选项,如下所示:

stylus: generateLoaders('stylus', {

  // unfortunately `use` option throws error
  // use: [require('nib')(), require('rupture')()]

  // import to the rescue
  import: [
    '~nib/index.styl',
    '~rupture/rupture/index.styl',
    path.resolve(__dirname, '../src/styles/cfg.styl')
  ]
}),

注意:如果
导入
选项中提供的任何路径不正确,服务器会自动进入挂起状态,不会启动-不会抛出错误。

@import'~break/break/index.styl'
?Super,不知道
~
,这确实有效!不过,修改选项应该已经完成了这项工作。奇怪的是,它不工作。嗯,可能是因为节点8.0?没有足够的错误消息。。Just stylus loader失败。不幸的是,
@import
解决方案是本地的,仅适用于当前组件。所以它不适用于要求应该是全局的mixin。
@import'~breash/breash/index.styl'
?超级,不知道
~
,这确实有效!不过,修改选项应该已经完成了这项工作。奇怪的是,它不工作。嗯,可能是因为节点8.0?没有足够的错误消息。。Just stylus loader失败。不幸的是,
@import
解决方案是本地的,仅适用于当前组件。因此,它不适用于要求应该是全局的mixin。