grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

how to build minified Css?

Open Abhisheknanda1344463 opened this issue 8 years ago • 8 comments

hi @artf Can You please explain me how can i build css from style section. Everytime when i run "Npm run build".Code build in min js only should i need to add file for css build??? Thanks.

Abhisheknanda1344463 avatar Sep 04 '18 17:09 Abhisheknanda1344463

npm run build minifies also CSS via "build-dev": "webpack --env=dev && npm run build:css",

artf avatar Sep 04 '18 22:09 artf

ok @artf thanks :)

Abhisheknanda1344463 avatar Sep 05 '18 05:09 Abhisheknanda1344463

@artf With command "Npm run build" my css doesn't get build. i tried npm run build:css it shows error && various scripts are written in my package.json as shown below. My all css is in the Style folder.

  • "lint": "eslint src",
  • "v:patch": "npm version --no-git-tag-version patch",
  • "build": "npm run v:patch && webpack --env.production",
  • "start": "webpack-dev-server --open --progress --colors"

Abhisheknanda1344463 avatar Sep 05 '18 17:09 Abhisheknanda1344463

If you don't show the error how can I help you???

artf avatar Sep 06 '18 21:09 artf

@artf i got the solution by adding two scripts in package.json

"build:css": "node-sass src/style/YourFileName.scss dist/Filename.min.css
"start:": "WEBPACK_ENV=dev ./node_modules/.bin/webpack-dev-server --progress --colors & npm run build:css --w

but the problem is that it will generated unminified css in the dist folder how could i generate minified css in that file should i write another script ?

Abhisheknanda1344463 avatar Sep 07 '18 12:09 Abhisheknanda1344463

@Abhisheknanda1344463 @artf i also did same but i did not get minified css

Siddharth-ss42279 avatar Sep 07 '18 13:09 Siddharth-ss42279

@Abhisheknanda1344463 @Siddharth-ss42279 guys... it's not difficult... look here https://github.com/artf/grapesjs/blob/dev/package.json#L105 there is an option... --output-style compressed come on...

artf avatar Sep 10 '18 21:09 artf

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 17 '19 06:09 lock[bot]