Evan You 8 лет назад
Родитель
Сommit
64a0785b4e
4 измененных файлов с 13 добавлено и 5 удалено
  1. 0 1
      .gitignore
  2. 9 0
      build/rollup.logger.config.js
  3. 0 0
      dist/logger.d.ts
  4. 4 4
      package.json

+ 0 - 1
.gitignore

@@ -3,7 +3,6 @@ node_modules
 TODO.md
 TODO.md
 lib
 lib
 docs/_book
 docs/_book
-logger.js
 examples/**/build.js
 examples/**/build.js
 types/typings
 types/typings
 types/test/*.js
 types/test/*.js

+ 9 - 0
build/rollup.logger.config.js

@@ -0,0 +1,9 @@
+const buble = require('rollup-plugin-buble')
+
+module.exports = {
+  entry: 'src/plugins/logger.js',
+  dest: 'dist/logger.js',
+  format: 'umd',
+  moduleName: 'createVuexLogger',
+  plugins: [buble()]
+}

+ 0 - 0
logger.d.ts → dist/logger.d.ts


+ 4 - 4
package.json

@@ -9,14 +9,14 @@
     "src",
     "src",
     "types/index.d.ts",
     "types/index.d.ts",
     "types/helpers.d.ts",
     "types/helpers.d.ts",
-    "types/vue.d.ts",
-    "logger.js",
-    "logger.d.ts"
+    "types/vue.d.ts"
   ],
   ],
   "scripts": {
   "scripts": {
     "dev": "node examples/server.js",
     "dev": "node examples/server.js",
     "dev:dist": "rollup -wm -c build/rollup.config.js",
     "dev:dist": "rollup -wm -c build/rollup.config.js",
-    "build": "rollup -c build/rollup.config.js && uglifyjs dist/vuex.js -cm --comments -o dist/vuex.min.js",
+    "build": "npm run build:main && npm run build:logger",
+    "build:main": "rollup -c build/rollup.config.js && uglifyjs dist/vuex.js -cm --comments -o dist/vuex.min.js",
+    "build:logger": "rollup -c build/rollup.logger.config.js",
     "test": "eslint src && npm run test:unit && npm run test:e2e",
     "test": "eslint src && npm run test:unit && npm run test:e2e",
     "test:unit": "rollup -c build/rollup.config.js && jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
     "test:unit": "rollup -c build/rollup.config.js && jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
     "test:e2e": "node test/e2e/runner.js",
     "test:e2e": "node test/e2e/runner.js",