Skip to content

Commit

Permalink
improve watch script
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Aug 21, 2017
1 parent 9736877 commit 7d96d94
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 36 deletions.
17 changes: 14 additions & 3 deletions clean-scripts.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ module.exports = {
],
css: [
`image2base64-cli images/*.png images/*.gif --less src/variables.less --base images`,
`lessc src/tree.less > dist/tree.css`,
`cleancss -o dist/tree.min.css dist/tree.css`,
[
`lessc src/tree.less > dist/tree.css`,
`cleancss -o dist/tree.min.css dist/tree.css`
],
`cleancss -o demo/index.bundle.css dist/tree.min.css ./node_modules/github-fork-ribbon-css/gh-fork-ribbon.css`
],
clean: `rimraf demo/**/index.bundle-*.js demo/tree-icon-*.png demo/index.bundle-*.css`
Expand Down Expand Up @@ -53,5 +55,14 @@ module.exports = {
less: `stylelint --fix "src/**/*.less"`
},
release: `clean-release`,
watch: `watch-then-execute "src/**/*.ts" "src/**/*.tsx" "demo/**/*.ts" "demo/**/*.tsx" "src/**/*.template.html" --exclude "src/compiled/**/*,src/*-variables.ts" --script "npm run build"`
watch: {
vue: `file2variable-cli src/angular-node.template.html src/angular-tree.template.html -o src/angular-variables.ts --html-minify --base src --watch`,
angular: `file2variable-cli src/vue-node.template.html src/vue-tree.template.html -o src/vue-variables.ts --html-minify --base src --watch`,
src: `tsc -p src --watch`,
demo: `tsc -p demo --watch`,
webpack: `webpack --display-modules --config demo/webpack.config.js --watch`,
image: `image2base64-cli images/*.png images/*.gif --less src/variables.less --base images --watch`,
less: `watch-then-execute "src/*.less" --script "clean-scripts build[2].css[1]"`,
rev: `rev-static --config demo/rev-static.config.js --watch`
}
}
4 changes: 2 additions & 2 deletions demo/file-size.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"angularIndexBundleJs": "769 kB 192 kB",
"reactIndexBundleJs": "164 kB 48.6 kB",
"vueIndexBundleJs": "100 kB 34.3 kB",
"indexBundleCss": "38.9 kB 8.95 kB",
"reactIndexBundleJs": "164 kB 48.6 kB",
"treeIconPng": "636 B 647 B",
"vueIndexBundleJs": "100 kB 34.3 kB",
"demoAngularIndexHtml": "783 B 534 B",
"demoReactIndexHtml": "798 B 544 B",
"demoVueIndexHtml": "798 B 547 B"
Expand Down
63 changes: 37 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"clean-release": "1.3.2",
"clean-scripts": "1.2.3",
"core-js": "2.4.1",
"file2variable-cli": "1.4.1",
"file2variable-cli": "1.5.2",
"github-fork-ribbon-css": "0.2.1",
"image2base64-cli": "2.0.2",
"image2base64-cli": "2.1.0",
"jasmine": "2.7.0",
"karma": "1.7.0",
"karma-chrome-launcher": "2.2.0",
Expand All @@ -50,7 +50,7 @@
"no-unused-export": "1.1.0",
"react": "15.6.1",
"react-dom": "15.6.1",
"rev-static": "3.2.2",
"rev-static": "3.3.1",
"rimraf": "2.6.1",
"rxjs": "5.4.2",
"standard": "10.0.2",
Expand Down
Loading

0 comments on commit 7d96d94

Please sign in to comment.