chore: use parameters when embedding dependencies, validate build
This commit is contained in:
Родитель
9037c2ad8b
Коммит
71f9969417
|
@ -1,13 +1,19 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# Usage: embed-dependnecies.sh [module-name]...
|
||||
|
||||
mkdir -p modules
|
||||
mkdir -p modules/bootstrap
|
||||
mkdir -p modules/@progress/kendo-theme-default
|
||||
|
||||
# copy dependencies from node_modules/ to modules/ subdir
|
||||
rsync -avc --delete --include "**.scss" node_modules/bootstrap/ modules/bootstrap/
|
||||
rsync -avc --delete --include "**.scss" node_modules/@progress/kendo-theme-default/ modules/@progress/kendo-theme-default/
|
||||
for module in "$@"
|
||||
do
|
||||
# copy dependencies from node_modules/ to modules/ subdir
|
||||
echo "Copy $module dependency"
|
||||
mkdir -p modules/$module
|
||||
rsync -avc --delete --include "**.scss" node_modules/$module/ modules/$module/
|
||||
done
|
||||
|
||||
# replace references to modules
|
||||
# replace references to modules with relative paths
|
||||
find ./scss/ -maxdepth 1 -type f -name "*.scss" -exec sed -i 's#\(@import\s\+\)\(''\|\"\)~\(.*\);#\1\2../modules/\3;#' "{}" \;
|
||||
find ./scss/ -maxdepth 2 -type f -name "*.scss" -exec sed -i 's#\(@import\s\+\)\(''\|\"\)~\(.*\);#\1\2../../modules/\3;#' "{}" \;
|
||||
find ./scss/ -maxdepth 3 -type f -name "*.scss" -exec sed -i 's#\(@import\s\+\)\(''\|\"\)~\(.*\);#\1\2../../../modules/\3;#' "{}" \;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"build": "webpack --optimize-minimize --bail",
|
||||
"watch": "webpack --watch",
|
||||
"test": "npm run lint && npm run build && npm run api-check",
|
||||
"prepublishOnly": "build/embed-dependencies.sh",
|
||||
"prepublishOnly": "./build/embed-dependencies.sh bootstrap '@progress/kendo-theme-default' && npm run build",
|
||||
"semantic-release": "semantic-release pre && semantic-prerelease publish && semantic-release post"
|
||||
},
|
||||
"config": {
|
||||
|
|
Загрузка…
Ссылка в новой задаче