After assembling the project in production mode, my styles disappear (version 1.3.1)
See original GitHub issueMy config:
require('dotenv').config();
module.exports = {
head: {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
link: [
{rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Montserrat:400,600,700&display=swap'}
],
},
css: [
'~/assets/scss/common.scss',
'~/assets/scss/3rd-party/font-awesome/font-awesome.scss',
],
modules: [
'nuxt-leaflet',
'@nuxtjs/axios',
'@nuxtjs/auth',
'@nuxtjs/toast',
['@nuxtjs/router', {keepDefaultRouter: true, fileName: './routes'}],
],
buildModules: [
'@nuxtjs/tailwindcss'
],
/*
Modules.
*/
auth: {
strategies: {
local: {
endpoints: {
login: { url: `${process.env.API_URL}/api/users/login`, method: 'post', propertyName: 'token' },
logout: { url: `${process.env.API_URL}/api/users/logout`, method: 'post' },
user: { url: `${process.env.API_URL}/api/users/me`, method: 'post', propertyName: false },
},
}
}
},
toast: {
duration: 3000,
},
build: {
extractCSS: true,
},
};
Styles from files do not get into the assembly for some reason (assets/scss/common.scss, assets/scss/3rd-party/font-awesome/font-awesome.scss)
In dev mode:
In prod mode: (nuxt build && nuxt start)
Sorry for my English 😢
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:17 (1 by maintainers)
Top Results From Across the Web
After assembling the project in production mode, my styles ...
My config: require('dotenv').config(); module.exports = { head: ... the project in production mode, my styles disappear (version 1.3.1) #55.
Read more >A Case Study at Fläkt Woods in Jönköping - DiVA Portal
The aim of the thesis is to investigate the problem of missing items at the time of production. 1.3.1 Research Questions: 1. What...
Read more >Gaea 1.3 now available - QuadSpinner Blog
We're happy to announce that Gaea 1.3 - our biggest and most powerful update yet - is ready for production! Download Gaea 1.3...
Read more >TikZ and pgf
A copy of the license is included in the section entitled LATEX Project Public License. 2. Page 3. The TikZ and PGF Packages....
Read more >Docker Compose release notes | Docker Documentation
Docker Compose now uses the native Docker CLI's build command when building images. Set the COMPOSE_DOCKER_CLI_BUILD=0 environment variable to disable this ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would also like to mention that, from my understanding, the way PurgeCSS works is very simple, it simply read through your source code and see if a CSS class is being used in your template. For example, you have a CSS class like this in style:
But if you never use
my-button
in your template then PurgeCSS will remove it to keep the final bundle size small. And it will check for the exact string. Therefore the following will not work: Let say you have two classes:Then in template
Or
As shown above, it is constructing the class with Template literals and depending on some state, the class will be different. And because PurgeCSS can’t find the exact strings “bg-red” and “bg-blue”, both classes will be removed.
Hence you need to do:
or
This is also mentioned in TailwindCSS’ doc https://tailwindcss.com/docs/controlling-file-size/#writing-purgeable-html
@andruu
I like to create a single file for the plugin, this named
tailwind.css
in theassets/css
directory. put content as following