diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 0000000..0a918b9
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,7 @@
+{
+ "root": true,
+ "extends": "vue",
+ "env": {
+ "mocha": true
+ }
+}
diff --git a/.gitignore b/.gitignore
index 91dfed8..6218a0b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.DS_Store
-node_modules
\ No newline at end of file
+node_modules
+test/temp
diff --git a/README.md b/README.md
index da918e0..9a42c15 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,13 @@
-# vueify [](https://circleci.com/gh/vuejs/vueify) [](http://badge.fury.io/js/vueify)
+# THIS REPOSITORY IS DEPRECATED
+
+> Note: We are concentrating our efforts on supporting webpack and rollup.
+
+## vueify [](https://circleci.com/gh/vuejs/vueify) [](http://badge.fury.io/js/vueify)
> [Browserify](http://browserify.org/) transform for [Vue.js](http://vuejs.org/) components, with scoped CSS and component hot-reloading.
+**NOTE: master branch now hosts version ^9.0, which only works with Vue ^2.0. Vueify 8.x which works with Vue 1.x is in the [8.x branch](https://github.com/vuejs/vueify/tree/8.x).**
+
This transform allows you to write your components in this format:
``` html
@@ -67,17 +73,6 @@ npm install vueify --save-dev
browserify -t vueify -e src/main.js -o build/build.js
```
-If you are using npm 3+, it no longer auto install the peer dependencies. So you will also have to also install the babel-related dependencies:
-
-``` bash
-npm install\
- babel-core\
- babel-preset-es2015\
- babel-runtime\
- babel-plugin-transform-runtime\
- --save-dev
-```
-
And this is all you need to do in your main entry file:
``` js
@@ -86,9 +81,9 @@ var Vue = require('vue')
var App = require('./app.vue')
new Vue({
- el: 'body',
- components: {
- app: App
+ el: '#app',
+ render: function (createElement) {
+ return createElement(App)
}
})
```
@@ -97,7 +92,7 @@ In your HTML:
``` html
-
+
```
@@ -121,35 +116,34 @@ Make sure to have the `NODE_ENV` environment variable set to `"production"` when
If you are using Gulp, note that `gulp --production` **does not** affect vueify; you still need to explicitly set `NODE_ENV=production`.
-## ES2015 by Default
-
-Vueify automatically transforms the JavaScript in your `*.vue` components using Babel. Write ES2015 today!
+## ES2015 with Babel
-The default Babel (6) options used for Vue.js components are:
+Vueify is pre-configured to work with Babel. Simply install Babel-related dependencies:
-``` js
-{
- "presets": ["es2015"],
- "plugins": ["transform-runtime"]
-}
+``` bash
+npm install\
+ babel-core\
+ babel-preset-es2015\
+ --save-dev
```
-If you wish to override this, you can add a `.babelrc` file at the root of your project:
+Then create a `.babelrc`:
``` json
{
- "presets": ["es2015", "stage-2"],
- "plugins": ["transform-runtime"]
+ "presets": ["es2015"]
}
```
+And voila! You can now write ES2015 in your `*.vue` files. Note if you want to use ES2015 on normal `*.js` files, you will also need [babelify](https://github.com/babel/babelify).
+
You can also configure babel with the `babel` field in `vue.config.js`, which will take the highest priority.
-## Enabling Pre-Processors
+## Enabling Other Pre-Processors
-You need to install the corresponding node modules to enable the compilation. e.g. to get stylus compiled in your Vue components, do `npm install stylus --save-dev`.
+For other pre-processors, you also need to install the corresponding node modules to enable the compilation. e.g. to get stylus compiled in your Vue components, do `npm install stylus --save-dev`.
-These are the built-in preprocessors:
+These are the preprocessors supported by vueify out of the box:
- stylus
- less
@@ -158,13 +152,9 @@ These are the built-in preprocessors:
- pug
- coffee-script (use `coffee` in [config section](#configuring-options))
-## Autoprefix by Default
-
-Starting in 5.0.0, all CSS output via vueify will be autoprefixed by default. See [config section](#configuring-options) below on customizing the options.
-
## PostCSS
-Vueify uses PostCSS for scoped CSS rewrite and autoprefixing. You can also provide your own PostCSS plugins! See [config section](#configuring-options) below for an example.
+Vueify uses PostCSS for scoped CSS rewrite. You can also provide your own PostCSS plugins! See [config section](#configuring-options) below for an example.
## Configuring Options
@@ -178,15 +168,6 @@ module.exports = {
},
// provide your own postcss plugins
postcss: [...],
- // configure autoprefixer
- autoprefixer: {
- browsers: ['last 2 versions']
- },
- // configure html minification in production mode
- // see https://github.com/kangax/html-minifier#options-quick-reference
- htmlMinifier: {
- // ...
- },
// register custom compilers
customCompilers: {
// for tags with lang="ts"
@@ -209,9 +190,7 @@ Example using custom PostCSS plugin:
var cssnext = require('cssnext')
module.exports = {
- postcss: [cssnext()],
- // disable autoprefixer since cssnext comes with it
- autoprefixer: false
+ postcss: [cssnext()]
}
```
@@ -251,9 +230,7 @@ browserify('./main.js')
.pipe(fs.createWriteStream("bundle.js"))
```
-### Scoped CSS
-
-> Experimental
+## Scoped CSS
When a `
diff --git a/test/fixtures/basic.vue b/test/fixtures/basic.vue
index 3996ac9..5dce8c7 100644
--- a/test/fixtures/basic.vue
+++ b/test/fixtures/basic.vue
@@ -1,25 +1,19 @@
-
-
-
hello
-
-
+
{{msg}}
+
+
diff --git a/test/fixtures/custom.vue b/test/fixtures/custom.vue
deleted file mode 100644
index e5a016e..0000000
--- a/test/fixtures/custom.vue
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/test/fixtures/empty.vue b/test/fixtures/empty.vue
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fixtures/imports/import.less b/test/fixtures/imports/import.less
deleted file mode 100644
index 6679fe0..0000000
--- a/test/fixtures/imports/import.less
+++ /dev/null
@@ -1 +0,0 @@
-@base: #f938ab;
diff --git a/test/fixtures/imports/import.sass b/test/fixtures/imports/import.sass
deleted file mode 100644
index 6fb403e..0000000
--- a/test/fixtures/imports/import.sass
+++ /dev/null
@@ -1,2 +0,0 @@
-$font-stack: Helvetica, sans-serif;
-$primary-color: #333;
diff --git a/test/fixtures/imports/import.styl b/test/fixtures/imports/import.styl
deleted file mode 100644
index b08b59b..0000000
--- a/test/fixtures/imports/import.styl
+++ /dev/null
@@ -1,2 +0,0 @@
-$font-stack = Helvetica, sans-serif;
-$primary-color = #333
diff --git a/test/fixtures/jade.vue b/test/fixtures/jade.vue
deleted file mode 100644
index 5b44d98..0000000
--- a/test/fixtures/jade.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-//- Declaration
-mixin list
- ul
- li foo
- li bar
- li baz
-//- Use
-+list
-+list
-
\ No newline at end of file
diff --git a/test/fixtures/less.vue b/test/fixtures/less.vue
deleted file mode 100644
index 060a45a..0000000
--- a/test/fixtures/less.vue
+++ /dev/null
@@ -1,17 +0,0 @@
-
diff --git a/test/fixtures/media-query.vue b/test/fixtures/media-query.vue
new file mode 100644
index 0000000..9dbe0ee
--- /dev/null
+++ b/test/fixtures/media-query.vue
@@ -0,0 +1,7 @@
+
diff --git a/test/fixtures/multiple-scripts.vue b/test/fixtures/multiple-scripts.vue
deleted file mode 100644
index 1ae4119..0000000
--- a/test/fixtures/multiple-scripts.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
diff --git a/test/fixtures/multiple-styles.vue b/test/fixtures/multiple-styles.vue
deleted file mode 100644
index 71496f9..0000000
--- a/test/fixtures/multiple-styles.vue
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/test/fixtures/multiple.vue b/test/fixtures/multiple.vue
deleted file mode 100644
index 1bfbc94..0000000
--- a/test/fixtures/multiple.vue
+++ /dev/null
@@ -1,33 +0,0 @@
-
-h1 Jade - node template engine
- #container.col
- a(href='http://vuejs.org') You are amazing
- p.
- Jade is a terse and simple
- templating language with a
- strong focus on performance
- and powerful features.
-
-
-
-
-
\ No newline at end of file
diff --git a/test/fixtures/non-minified.vue b/test/fixtures/non-minified.vue
deleted file mode 100644
index 0e9ecd0..0000000
--- a/test/fixtures/non-minified.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
hello
-
diff --git a/test/fixtures/postcss.vue b/test/fixtures/postcss.vue
new file mode 100644
index 0000000..a02d550
--- /dev/null
+++ b/test/fixtures/postcss.vue
@@ -0,0 +1,5 @@
+
diff --git a/test/fixtures/pre-processors.vue b/test/fixtures/pre-processors.vue
new file mode 100644
index 0000000..f59787e
--- /dev/null
+++ b/test/fixtures/pre-processors.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+div
+ h1 This is the app
+ comp-a
+ comp-b
+
+
+
diff --git a/test/fixtures/pug.vue b/test/fixtures/pug.vue
index d1b7643..5a43989 100644
--- a/test/fixtures/pug.vue
+++ b/test/fixtures/pug.vue
@@ -1,11 +1,6 @@
-//- Declaration
-mixin list
- ul
- li foo
- li bar
- li baz
-//- Use
-+list
-+list
+div
+ h1 This is the app
+ comp-a
+ comp-b
diff --git a/test/fixtures/sass.vue b/test/fixtures/sass.vue
deleted file mode 100644
index 3930c28..0000000
--- a/test/fixtures/sass.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/test/fixtures/scoped-css.vue b/test/fixtures/scoped-css.vue
new file mode 100644
index 0000000..ce28b06
--- /dev/null
+++ b/test/fixtures/scoped-css.vue
@@ -0,0 +1,20 @@
+
+
+
+