Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update makefile section in tailwindcss #1890

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Guide/tailwindcss.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ We also need a CSS entry point for Tailwind. Create a new file at `tailwind/app.
We need to add a new build command for starting a tailwind build process to our `Makefile`. For that append this to the `Makefile` in your project:

```makefile
tailwind-dev:
tailwindcss -c tailwind/tailwind.config.js -i ./tailwind/app.css -o static/app.css --watch
# Install npm packages. We have `NODE_ENV=production` so it won't install `devDependencies`
node_modules:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely because you already have a node_modules directory. Can you delete it and try again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried again (using this PR), but the same message

image

NODE_ENV=production npm ci
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need NODE_ENV=production?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it doesn't install devDependencies


# We rely on the `node_modules`. So if `node_modules` directory doesn't exist, calling `make tailwind-dev` will trigger `make node_modules`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if node_modules directory doesn't exist

As make node_modules didn't work for me I wasn't able to confirm this.

tailwind-dev: node_modules
node_modules/.bin/tailwindcss -c tailwind/tailwind.config.js -i ./tailwind/app.css -o static/app.css --watch
```

**Make requires tab characters instead of 4 spaces in the second line. Make sure you're using a tab character when pasting this into the file**
Expand All @@ -108,8 +113,8 @@ This defines a new command `make tailwind-dev` that runs `npx tailwindcss build`
For production builds, we also need a new make target:

```makefile
static/app.css:
tailwindcss -c tailwind/tailwind.config.js -i ./tailwind/app.css -o static/app.css --minify
static/app.css: node_modules
NODE_ENV=production node_modules/.bin/tailwind -c tailwind/tailwind.config.js -i ./tailwind/app.css -o static/app.css --minify
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NODE_ENV=production node_modules/.bin/tailwind -c tailwind/tailwind.config.js -i ./tailwind/app.css -o static/app.css --minify
node_modules/.bin/tailwindcss -c tailwind/tailwind.config.js -i ./tailwind/app.css -o static/app.css --minify

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK NODE_ENV=production was needed before purging was automatic

```

**Make requires tab characters instead of 4 spaces in the second line. Make sure you're using a tab character when pasting this into the file**
Expand Down
Loading