npm i gulp-file-common
it used for bundling resources(scripts, pages, styles and fonts)
- if you want to use this package, you need add a config file (The sibling directory of package.json), which called
pages.config.js
. in this file, it show the path of resources.
here is example of this file:
module.exports = {
build: {
src: "src", //your resources directory(need to be compressed and compiled, like styles file, scripts file, fonts and images)
dist: "release", //bundle file directory
temp: ".tmp", //temporary directory
public: "public", // your resources(no need to be compressed and compiled, like favicon.ico)
paths: {
styles: "assets/styles/*.scss",
scripts: "assets/scripts/*.js",
pages: "**/*.html",
images: "assets/images/**",
fonts: "assets/fonts/**",
},
},
};
gulp-file-common clean
- remove bundle folder(.tmp and release)
gulp-file-common build
- bundle all resource(scripts, styles, fonts, pages) into folder(.tmp and release)
gulp-file-common start
-
bundle some resource(scripts, styles, pages) into folder(.tmp)
-
then add a web server to run your project in a browser(port: 3002)
- use gulp-file-common as cli command( you need add these command into npm scripts)
"scripts": {
"clean": "gulp-file-common clean",
"build": "gulp-file-common build",
"start": "gulp-file-common start"
},
- now you can run these command
npm run clean
npm run build
npm run start
- after you download
gulp-file-common
package, you can use npx run command directly
npx gulp-file-common clean
npx gulp-file-common build
npx gulp-file-common start
- zce/caz - A simple yet powerful template-based Scaffolding tools.