Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
CreateSean committed Mar 26, 2021
1 parent 5f34f97 commit 1cdc3e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ Password: `letmein`

## Build Process

Tailwind is compiled using [Tailwind-jit](https://github.com/tailwindlabs/tailwindcss-jit) which is much faster than previously. it also ensures a small file size during `watch` builds. However I still recommend running the [production](#production) task before deployment.

Images and svg files should be copied to src/img and src/img/svg. When running `npm run production` these will then be optimized and copied to /public/assets/images and /public/assets/images/svg respectively (if you don't want to run production, copy files to both locations)

You will need [NodeJS](https://nodejs.org/en/) version 14+. YOu can either update to 14+ or if you need multiple versions of node install the Node Version Manager [Windows](https://github.com/nvm-sh/nvm) / [Mac](https://github.com/coreybutle/nvm-windows).

1. run `npm install` or `npm i`

Add any scripts or css you need by running `npm install <package-name> --save-dev`
You can then have the required javascript or css files combined and minimized by adding paths to the correct files in `webpack.mix.js` on line 64-70(js) or line 74-78(css). when you run `npm run watch` everything will be combined and output to `/public/assets/js` or `public/assets/css`
You can then have the required javascript or css files combined and minimized by adding paths to the correct files in `webpack.mix.js` on line 64-70(js) or line 74-78(css). when you run `npx mix watch` everything will be combined and output to `/public/assets/js` or `public/assets/css`

2. update the banner text that gets prepended to css on lines 75-85 of `webpack.mix.js` with your project info
3. in `webpack.mix.js` update line 12 `const baseUrl = 'https://craft-starter.ddev.site'` with your local domain
Expand All @@ -58,13 +60,13 @@ You can then have the required javascript or css files combined and minimized by
})
```

4. run `npm run watch` to have laravel mix compile tailwind, set up browser sync. and combine scripts.
4. run `npx mix watch` to have laravel mix compile tailwind, set up browser sync. and combine scripts.

### Production

when you are ready to deploy your code run `npm run production` to optimize images in `/src/img/` optimized images will be output in `/public/assets/images`
when you are ready to deploy your code run `npx mix -pn` to optimize images in `/src/img/` optimized images will be output in `/public/assets/images`

this will also run the critical css task which you can configure at line 118 by adding in an array of urls and templates
this will also run the critical css task which you can configure at line 143 by adding in an array of urls and templates

```javascript
urls: [{
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,22 @@
"cssnano": "^4.1.10",
"git-rev-sync": "^1.12.0",
"glob-all": "^3.1.0",
"hamburgers": "^0.9.3",
"imagemin-mozjpeg": "^8.0.0",
"imagemin-webpack-plugin": "^2.4.2",
"intersection-observer": "^0.5.1",
"jarallax": "^1.10.7",
"jquery": "^3.3.1",
"laravel-mix-banner": "^0.1.4",
"laravel-mix-criticalcss": "^1.0.1",
"laravel-mix-imagemin": "^1.0.3",
"laravel-mix-tailwind": "^0.1.0",
"lazysizes": "^2.0.6",
"moment": "^2.24.0",
"particles.js": "^2.0.0",
"postcss": "^8.2.8",
"postcss-easy-import": "^3.0.0",
"postcss-font-magician": "^2.2.1",
"postcss-hexrgba": "^1.0.2",
"postcss-loader": "^5.2.0",
"postcss-preset-env": "^6.6.0",
"resolve-url-loader": "^3.0.1",
"sal.js": "^0.5.0",
"stylelint-config-recommended": "^2.2.0",
"tailwindcss": "^2.0.4",
"vue-template-compiler": "^2.6.12"
Expand Down

0 comments on commit 1cdc3e5

Please sign in to comment.