mirror of
https://github.com/tabler/tabler.git
synced 2025-12-21 17:34:25 +04:00
refactor: Update build scripts and asset management across packages (#2558)
This commit is contained in:
@@ -5,30 +5,31 @@
|
|||||||
"homepage": "https://tabler.io",
|
"homepage": "https://tabler.io",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm run clean && pnpm run copy && pnpm run watch",
|
"dev": "pnpm run clean && pnpm run copy && pnpm run watch",
|
||||||
"build": "pnpm run clean && pnpm run css && pnpm run js && pnpm run copy && pnpm run generate-sri",
|
"build": "pnpm run clean && pnpm run build-assets && pnpm run copy && pnpm run generate-sri",
|
||||||
|
"build-assets": "concurrently \"pnpm run css\" \"pnpm run js\"",
|
||||||
"clean": "shx rm -rf dist demo",
|
"clean": "shx rm -rf dist demo",
|
||||||
"css": "pnpm run css-compile && pnpm run css-prefix && pnpm run css-rtl && pnpm run css-minify && pnpm run css-banner",
|
"css": "pnpm run css-compile && pnpm run css-prefix && pnpm run css-rtl && pnpm run css-minify && pnpm run css-banner",
|
||||||
"css-compile": "sass --no-source-map --load-path=node_modules --style expanded scss/:dist/css/",
|
"css-compile": "sass --no-source-map --load-path=node_modules --style expanded scss/:dist/css/",
|
||||||
"css-banner": "node .build/add-banner.mjs",
|
"css-banner": "node .build/add-banner.mjs",
|
||||||
"css-prefix": "postcss --config .build/postcss.config.mjs --replace \"dist/css/*.css\" \"!dist/css/*.rtl*.css\" \"!dist/css/*.min.css\"",
|
"css-prefix": "postcss --config .build/postcss.config.mjs --replace \"dist/css/*.css\" \"!dist/css/*.rtl*.css\" \"!dist/css/*.min.css\"",
|
||||||
"css-rtl": "cross-env NODE_ENV=RTL postcss --config .build/postcss.config.mjs --dir \"dist/css\" --ext \".rtl.css\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*.rtl.css\"",
|
"css-rtl": "cross-env NODE_ENV=RTL postcss --config .build/postcss.config.mjs --dir \"dist/css\" --ext \".rtl.css\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*.rtl.css\"",
|
||||||
"css-minify": "pnpm run css-minify-main && pnpm run css-minify-rtl",
|
"css-minify": "concurrently \"pnpm run css-minify-main\" \"pnpm run css-minify-rtl\"",
|
||||||
"css-minify-main": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*rtl*.css\"",
|
"css-minify-main": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*rtl*.css\"",
|
||||||
"css-minify-rtl": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*rtl.css\" \"!dist/css/*.min.css\"",
|
"css-minify-rtl": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*rtl.css\" \"!dist/css/*.min.css\"",
|
||||||
"css-lint": "pnpm run css-lint-variables",
|
"css-lint": "pnpm run css-lint-variables",
|
||||||
"css-lint-variables": "find-unused-sass-variables scss/ node_modules/bootstrap/scss/",
|
"css-lint-variables": "find-unused-sass-variables scss/ node_modules/bootstrap/scss/",
|
||||||
"js": "pnpm run js-compile && pnpm run js-minify",
|
"js": "pnpm run js-compile && pnpm run js-minify",
|
||||||
"js-compile": "pnpm run js-compile-standalone && pnpm run js-compile-standalone-esm && pnpm run js-compile-theme && pnpm run js-compile-theme-esm",
|
"js-compile": "concurrently \"pnpm run js-compile-standalone\" \"pnpm run js-compile-standalone-esm\" \"pnpm run js-compile-theme\" \"pnpm run js-compile-theme-esm\"",
|
||||||
"js-compile-theme-esm": "rollup --environment THEME:true --environment ESM:true --config .build/rollup.config.mjs --sourcemap",
|
"js-compile-theme-esm": "rollup --environment THEME:true --environment ESM:true --config .build/rollup.config.mjs --sourcemap",
|
||||||
"js-compile-theme": "rollup --environment THEME:true --config .build/rollup.config.mjs --sourcemap",
|
"js-compile-theme": "rollup --environment THEME:true --config .build/rollup.config.mjs --sourcemap",
|
||||||
"js-compile-standalone": "rollup --config .build/rollup.config.mjs --sourcemap",
|
"js-compile-standalone": "rollup --config .build/rollup.config.mjs --sourcemap",
|
||||||
"js-compile-standalone-esm": "rollup --environment ESM:true --config .build/rollup.config.mjs --sourcemap",
|
"js-compile-standalone-esm": "rollup --environment ESM:true --config .build/rollup.config.mjs --sourcemap",
|
||||||
"js-minify": "pnpm run js-minify-standalone && pnpm run js-minify-standalone-esm && pnpm run js-minify-theme && pnpm run js-minify-theme-esm",
|
"js-minify": "concurrently \"pnpm run js-minify-standalone\" \"pnpm run js-minify-standalone-esm\" \"pnpm run js-minify-theme\" \"pnpm run js-minify-theme-esm\"",
|
||||||
"js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler.js.map,includeSources,url=tabler.min.js.map\" --output dist/js/tabler.min.js dist/js/tabler.js",
|
"js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler.js.map,includeSources,url=tabler.min.js.map\" --output dist/js/tabler.min.js dist/js/tabler.js",
|
||||||
"js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler.esm.js.map,includeSources,url=tabler.esm.min.js.map\" --output dist/js/tabler.esm.min.js dist/js/tabler.esm.js",
|
"js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler.esm.js.map,includeSources,url=tabler.esm.min.js.map\" --output dist/js/tabler.esm.min.js dist/js/tabler.esm.js",
|
||||||
"js-minify-theme": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler-theme.js.map,includeSources,url=tabler-theme.min.js.map\" --output dist/js/tabler-theme.min.js dist/js/tabler-theme.js",
|
"js-minify-theme": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler-theme.js.map,includeSources,url=tabler-theme.min.js.map\" --output dist/js/tabler-theme.min.js dist/js/tabler-theme.js",
|
||||||
"js-minify-theme-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler-theme.esm.js.map,includeSources,url=tabler-theme.esm.min.js.map\" --output dist/js/tabler-theme.esm.min.js dist/js/tabler-theme.esm.js",
|
"js-minify-theme-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler-theme.esm.js.map,includeSources,url=tabler-theme.esm.min.js.map\" --output dist/js/tabler-theme.esm.min.js dist/js/tabler-theme.esm.js",
|
||||||
"copy": "pnpm run copy-img && pnpm run copy-libs && pnpm run copy-fonts",
|
"copy": "concurrently \"pnpm run copy-img\" \"pnpm run copy-libs\" \"pnpm run copy-fonts\"",
|
||||||
"copy-img": "shx mkdir -p dist/img && shx cp -rf img/* dist/img",
|
"copy-img": "shx mkdir -p dist/img && shx cp -rf img/* dist/img",
|
||||||
"copy-libs": "node .build/copy-libs.mjs",
|
"copy-libs": "node .build/copy-libs.mjs",
|
||||||
"copy-fonts": "shx mkdir -p dist/fonts && shx cp -rf fonts/* dist/fonts",
|
"copy-fonts": "shx mkdir -p dist/fonts && shx cp -rf fonts/* dist/fonts",
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm run clean && pnpm run js && pnpm run css && pnpm run html ",
|
"build": "pnpm run clean && pnpm run build-assets && pnpm run html",
|
||||||
|
"build-assets": "concurrently \"pnpm run js\" \"pnpm run css\"",
|
||||||
"html": "eleventy",
|
"html": "eleventy",
|
||||||
"js": "pnpm run js-compile && pnpm run js-minify",
|
"js": "pnpm run js-compile && pnpm run js-minify",
|
||||||
"js-compile": "rollup --config .build/rollup.config.mjs --sourcemap",
|
"js-compile": "rollup --config .build/rollup.config.mjs --sourcemap",
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm run clean && pnpm run css && pnpm run js && pnpm run html",
|
"build": "pnpm run clean && pnpm run build-assets && pnpm run html",
|
||||||
|
"build-assets": "concurrently \"pnpm run css\" \"pnpm run js\"",
|
||||||
"dev": "pnpm run clean && pnpm run watch",
|
"dev": "pnpm run clean && pnpm run watch",
|
||||||
"watch": "concurrently \"pnpm run watch-html\" \"pnpm run watch-css\" \"pnpm run watch-js\"",
|
"watch": "concurrently \"pnpm run watch-html\" \"pnpm run watch-css\" \"pnpm run watch-js\"",
|
||||||
"watch-html": "cross-env NODE_ENV=development eleventy --serve --port=3000 --watch --incremental",
|
"watch-html": "cross-env NODE_ENV=development eleventy --serve --port=3000 --watch --incremental",
|
||||||
|
|||||||
26
turbo.json
26
turbo.json
@@ -11,17 +11,32 @@
|
|||||||
"^build"
|
"^build"
|
||||||
],
|
],
|
||||||
"inputs": [
|
"inputs": [
|
||||||
|
"core/scss/**",
|
||||||
|
"core/js/**",
|
||||||
|
"core/img/**",
|
||||||
|
"core/fonts/**",
|
||||||
|
"core/.build/**",
|
||||||
|
"preview/pages/**",
|
||||||
|
"preview/scss/**",
|
||||||
|
"preview/js/**",
|
||||||
|
"preview/.build/**",
|
||||||
|
"docs/content/**",
|
||||||
|
"docs/scss/**",
|
||||||
|
"docs/js/**",
|
||||||
|
"docs/.build/**",
|
||||||
"shared/**",
|
"shared/**",
|
||||||
"preview/**"
|
"package.json",
|
||||||
|
"pnpm-lock.yaml"
|
||||||
],
|
],
|
||||||
"outputs": [
|
"outputs": [
|
||||||
"dist/**"
|
"dist/**",
|
||||||
|
"demo/**"
|
||||||
],
|
],
|
||||||
"cache": false
|
"cache": true
|
||||||
},
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"cache": false,
|
"cache": false,
|
||||||
"persistent": false
|
"persistent": true
|
||||||
},
|
},
|
||||||
"clean": {
|
"clean": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
@@ -32,7 +47,8 @@
|
|||||||
"bundlewatch": {
|
"bundlewatch": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"build"
|
"build"
|
||||||
]
|
],
|
||||||
|
"cache": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user