ykit-config-vue
ykit-config-vue
Features
- 编译 ES6+, Vue 代码(不需单独引入 es6 插件)
- 支持 SASS/SCSS
Usage
如果是新项目,在一个空的目录下执行:
$ ykit init vue
会在当前目录下生成一个初始工程。
如果是已有项目,在项目中执行:
$ npm install ykit-config-vue --save
编辑 ykit.js,引入插件:
module.exports = {
plugins: ['vue']
// ...
};
添加 .babelrc
注意:由于 vue-loader 配置的特殊性,还需要在项目中添加 .babelrc,否则配置的 babel 插件不会生效。 你也可以安装和配置更多的插件,下面只是参考配置:
{
"presets": [
["env", {
"modules": "commonjs",
"targets": {
"browsers": [
"> 1%",
"last 3 versions",
"ios 8",
"android 4.2",
"ie 9"
]
},
"useBuiltIns": "usage"
}]
],
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"transform-object-rest-spread",
"transform-object-assign"
]
}
配置项
提取样式为单独的 css 文件
module.exports = {
plugins: [
{
name: 'vue',
options: {
extractStyle: true // 默认是 false 不提取,如果为 true 则会在引入 scss 的当前文件下生成 css
}
}
]
};
示例
查看:https://github.com/roscoe054/ykit-starter-vue
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 3.0.2 | ^2.5.9 | ISC | |
| 3.0.1 | ^2.5.9 | ISC | |
| 3.0.0 | ^2.5.9 | ISC | |
| 2.0.10 | ^2.2.1 | ISC | |
| 2.0.9 | ^2.2.1 | ISC | |
| 2.0.8 | ^2.2.1 | ISC | |
| 2.0.7 | ^2.2.1 | ISC | |
| 2.0.6 | ^2.2.1 | ISC | |
| 2.0.5 | ^2.2.1 | ISC | |
| 2.0.4 | ^2.2.1 | ISC | |
| 2.0.3 | ^2.2.1 | ISC | |
| 2.0.2 | ^2.2.1 | ISC | |
| 2.0.1 | ^2.2.1 | ISC | |
| 2.0.0 | ^2.2.1 | ISC | |
| 1.2.2 | ^2.2.1 | ISC | |
| 1.2.1 | ^2.2.1 | ISC | |
| 1.2.0 | ^2.2.1 | ISC | |
| 1.1.0 | ^2.2.1 | ISC | |
| 0.2.4 | ^2.2.1 | ISC | |
| 0.2.3 | ^2.2.1 | ISC | |
| 0.2.2 | ^2.2.1 | ISC | |
| 0.2.1 | ^2.2.1 | ISC | |
| 0.2.0 | ^2.2.1 | ISC | |
| 0.1.1 | ^2.2.1 | ISC | |
| 0.1.0 | ^2.2.1 | ISC |
Pre-releases (5)
| Version | Released | Vue | License |
|---|---|---|---|
| 3.0.0-rc.0 | ^2.5.9 | ISC | |
| 2.0.10-alpha.1 | ^2.2.1 | ISC | |
| 2.0.10-alpha.0 | ^2.2.1 | ISC | |
| 2.0.0-rc.1 | ^2.2.1 | ISC | |
| 2.0.0-rc.0 | ^2.2.1 | ISC |