Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nuxt-modules/tailwindcss
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: nuxt-modules/tailwindcss
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.3.0
Choose a head ref
  • 4 commits
  • 5 files changed
  • 3 contributors

Commits on Jan 6, 2020

  1. chore(deps): update all non-major dependencies (#41)

    Co-authored-by: Renovate Bot <renovatebot@gmail.com>
    2 people authored and atinux committed Jan 6, 2020
    Copy the full SHA
    faaf2a9 View commit details
  2. Copy the full SHA
    9fe24f7 View commit details
  3. chore: lock devDependencies

    atinux committed Jan 6, 2020
    Copy the full SHA
    9fe7e22 View commit details
  4. 1.3.0

    atinux committed Jan 6, 2020
    Copy the full SHA
    81b4db8 View commit details
Showing with 2,525 additions and 2,404 deletions.
  1. +4 −1 README.md
  2. +7 −2 lib/module.js
  3. +24 −24 package.json
  4. +2 −2 test/fail.test.js
  5. +2,488 −2,375 yarn.lock
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -54,11 +54,14 @@ If you want to set a different path for the configuration file or css file, you
],
tailwindcss: {
configPath: '~/config/tailwind.config.js',
cssPath: '~/assets/css/tailwind.css'
cssPath: '~/assets/css/tailwind.css',
purgeCSSInDev: false
}
}
```

To enable purgeCSS in development, set `purgeCSSInDev: true`, be careful that it will slow down your development process.

If you want to set any (additional) purgeCSS configuration options, you can add a purgeCSS configuration object:

```js
9 changes: 7 additions & 2 deletions lib/module.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ module.exports = async function (moduleOptions) {
const options = {
configPath: 'tailwind.config.js',
cssPath: join(this.options.dir.assets, 'css', 'tailwind.css'),
purgeCSSInDev: false,
...this.options.tailwindcss,
...moduleOptions
}
@@ -45,8 +46,12 @@ module.exports = async function (moduleOptions) {
** Add nuxt-purgecss module and set config
** only for `nuxt build` command
*/
if (!this.options.dev) {
const purgeCSS = { mode: 'postcss', ...(this.options.purgeCSS || {}) }
if (!this.options.dev || options.purgeCSSInDev) {
const purgeCSS = {
mode: 'postcss',
...(this.options.purgeCSS || {}),
enabled: options.purgeCSSInDev ? true : undefined
}
await this.requireModule(['nuxt-purgecss', purgeCSS])
}
})
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nuxtjs/tailwindcss",
"version": "1.2.0",
"version": "1.3.0",
"description": "TailwindCSS module for Nuxt.js",
"license": "MIT",
"contributors": [
@@ -23,34 +23,34 @@
"lib"
],
"dependencies": {
"consola": "^2.10.1",
"consola": "^2.11.3",
"fs-extra": "^8.1.0",
"nuxt-purgecss": "^0.2.1",
"tailwindcss": "^1.1.3"
"tailwindcss": "^1.1.4"
},
"devDependencies": {
"@babel/core": "latest",
"@babel/preset-env": "latest",
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"@nuxtjs/eslint-config": "latest",
"babel-eslint": "latest",
"babel-jest": "latest",
"codecov": "latest",
"eslint": "latest",
"eslint-config-standard": "latest",
"eslint-plugin-import": "latest",
"eslint-plugin-jest": "latest",
"eslint-plugin-node": "latest",
"@babel/core": "^7.7.7",
"@babel/preset-env": "^7.7.7",
"@commitlint/cli": "^8.3.4",
"@commitlint/config-conventional": "^8.3.4",
"@nuxtjs/eslint-config": "^2.0.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"codecov": "^3.6.1",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jest": "^23.3.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "latest",
"eslint-plugin-standard": "latest",
"eslint-plugin-vue": "latest",
"get-port": "latest",
"husky": "latest",
"jest": "latest",
"nuxt-edge": "latest",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.1.2",
"get-port": "^5.1.0",
"husky": "^3.1.0",
"jest": "^24.9.0",
"nuxt-edge": "^2.11.1-26304489.a553c56c",
"request": "latest",
"request-promise-native": "latest",
"standard-version": "latest"
"request-promise-native": "^1.0.8",
"standard-version": "^7.0.1"
}
}
4 changes: 2 additions & 2 deletions test/fail.test.js
Original file line number Diff line number Diff line change
@@ -28,8 +28,8 @@ describe('fail', () => {
})

test('when copy files', () => {
expect(logger.warn).toHaveBeenNthCalledWith(1, `Could not create ~/tailwind.config.js:`, 'Error when copy')
expect(logger.warn).toHaveBeenNthCalledWith(2, `Could not create ~/assets/css/tailwind.css:`, 'Error when copy')
expect(logger.warn).toHaveBeenNthCalledWith(1, 'Could not create ~/tailwind.config.js:', 'Error when copy')
expect(logger.warn).toHaveBeenNthCalledWith(2, 'Could not create ~/assets/css/tailwind.css:', 'Error when copy')
expect(nuxt.options.css).toHaveLength(0)
})
})
Loading