diff --git a/.gitignore b/.gitignore index 4dbbb0de..479fe82a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules docs/ dist/ +dist-css/ es/ # local env files diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..13811443 --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +dist/demo.html +dist-css/demo.html \ No newline at end of file diff --git a/package.json b/package.json index 0265f7ab..11189e65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-slider-component", - "version": "3.0.17", + "version": "3.0.18", "description": "A highly customized slider component", "keywords": [ "vue", @@ -13,7 +13,7 @@ "typings": "./typings/index.d.ts", "files": [ "dist", - "es", + "dist-css", "lib", "src", "typings", @@ -32,9 +32,10 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "build:library": "npm run package && npm run typings && npm run sass", - "typings": "tsc -p tsconfig.package.json && cp -a lib/typings typings/typings", + "build:library": "npm run package && npm run package:css && npm run typings && npm run sass", "package": "vue-cli-service build --mode package --target lib --name vue-slider-component lib/index.ts", + "package:css": "NO_EXTRACT_CSS=true npm run package -- --dest dist-css", + "typings": "tsc -p tsconfig.package.json && cp -a lib/typings typings/typings", "sass": "sass lib/theme:theme", "prettier": "prettier --write lib/**/*.{ts,tsx,scss}", "lint": "vue-cli-service lint", diff --git a/vue.config.js b/vue.config.js index 80395312..2a701e2d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -69,5 +69,5 @@ module.exports = { config.output.libraryExport('default') } }, - css: { extract: false }, + css: { extract: !!process.env.NO_EXTRACT_CSS }, }