Browse Source

update build for compiler

Evan You 10 years ago
parent
commit
adb81363dd
4 changed files with 30 additions and 1 deletions
  1. 2 0
      .gitignore
  2. 13 0
      build/build.js
  3. 8 0
      dist/compiler/package.json
  4. 7 1
      package.json

+ 2 - 0
.gitignore

@@ -3,3 +3,5 @@ node_modules
 npm-debug.log
 explorations
 TODOs.md
+dist/*.gz
+dist/vue.common.min.js

+ 13 - 0
build/build.js

@@ -46,6 +46,19 @@ rollup.rollup({
   ])
 })
 .then(zip('dist/vue.common.min.js'))
+// Compiler CommonJS build.
+// Used in Node loaders/transforms.
+.then(function () {
+  return rollup.rollup({
+    entry: 'src/compiler/index.js',
+    plugins: [babel()]
+  })
+  .then(function (bundle) {
+    write('dist/compiler/compiler.js', bundle.generate({
+      format: 'cjs'
+    }).code)
+  })
+})
 // Standalone Dev Build
 .then(function () {
   return rollup.rollup({

+ 8 - 0
dist/compiler/package.json

@@ -0,0 +1,8 @@
+{
+  "name": "vue-template-compiler",
+  "version": "1.0.0",
+  "description": "Compile Vue templates into virtual dom render functions",
+  "main": "compiler.js",
+  "author": "Evan You",
+  "license": "MIT"
+}

+ 7 - 1
package.json

@@ -2,7 +2,13 @@
   "name": "vue-lite",
   "version": "2.0.0",
   "description": "Lighter-weight Vue on virtual dom",
-  "main": "index.js",
+  "main": "dist/vue.common.js",
+  "files": [
+    "dist/vue.common.js",
+    "dist/vue.js",
+    "dist/vue.min.js",
+    "src"
+  ],
   "scripts": {
     "dev": "webpack --watch",
     "test": "mocha",