vue-sfc-rollup
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -6,4 +6,6 @@ { | ||
"license": "ISC", | ||
"version": "0.2.0", | ||
"bin": { "sfc-rollup-init": "./sfc-init.js" }, | ||
"version": "0.3.0", | ||
"bin": { | ||
"sfc-rollup-init": "./sfc-init.js" | ||
}, | ||
"dependencies": { | ||
@@ -10,0 +12,0 @@ "readline-sync": "^1.4.9" |
# vue-sfc-rollup | ||
vue-sfc-rollup exists to provide the minimal setup necessary to compile a Vue Single File Component (SFC) into a form ready to share via npm. At present, this should be considered *alpha* software, and is subject to quite a bit of change. | ||
vue-sfc-rollup exists to provide the minimal setup necessary to compile a Vue Single File Component (SFC) into a form ready to share via npm. At present, this should be considered *beta* software. | ||
@@ -5,0 +5,0 @@ ## TL;DR |
@@ -5,4 +5,7 @@ // rollup.config.js | ||
import uglify from 'rollup-plugin-uglify-es'; | ||
import minimist from 'minimist'; | ||
export default { | ||
const argv = minimist(process.argv.slice(2)); | ||
const config = { | ||
input: 'src/index.js', | ||
@@ -19,4 +22,10 @@ output: { | ||
buble(), | ||
uglify(), | ||
], | ||
}; | ||
}; | ||
// Only minify browser (iife) version | ||
if (argv.format === 'iife') { | ||
config.plugins.push(uglify()); | ||
} | ||
export default config; |
@@ -9,24 +9,25 @@ { | ||
"unpkg": "dist/{{componentName}}.min.js", | ||
"browser": { | ||
"./sfc": "src/{{componentName}}.vue" | ||
}, | ||
"scripts": { | ||
"build": "npm run build:browser && npm run build:es && npm run build:umd", | ||
"build:browser": "rollup --config build/rollup.config.js --format iife --file dist/{{componentName}}.min.js", | ||
"build": "npm run build:unpkg & npm run build:es & npm run build:umd", | ||
"build:umd": "rollup --config build/rollup.config.js --format umd --file dist/{{componentName}}.umd.js", | ||
"build:es": "rollup --config build/rollup.config.js --format es --file dist/{{componentName}}.esm.js", | ||
"build:umd": "rollup --config build/rollup.config.js --format umd --file dist/{{componentName}}.umd.js" | ||
"build:unpkg": "rollup --config build/rollup.config.js --format iife --file dist/{{componentName}}.min.js" | ||
}, | ||
"dependencies": { | ||
"readline-sync": "^1.4.9" | ||
}, | ||
"devDependencies": { | ||
"minimist": "^1.2.0", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-buble": "^0.19.2", | ||
"rollup-plugin-uglify-es": "0.0.1", | ||
"rollup-plugin-vue": "^3.0.0", | ||
"vue": "^2.5.16", | ||
"vue-template-compiler": "^2.5.16", | ||
"rollup-plugin-buble": "^0.19.2", | ||
"rollup-plugin-uglify-es": "0.0.1" | ||
"vue-template-compiler": "^2.5.16" | ||
} | ||
} |
@@ -8,3 +8,3 @@ // Import vue component | ||
install.installed = true; | ||
Vue.component('{{componentName}}', component); | ||
Vue.component('{{componentNamePascal}}', component); | ||
} | ||
@@ -11,0 +11,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10463
140