diff --git a/examples/tailwindcss/nuxt.config.js b/examples/tailwindcss/nuxt.config.js
index 7550d05a97..c25eb8e4db 100644
--- a/examples/tailwindcss/nuxt.config.js
+++ b/examples/tailwindcss/nuxt.config.js
@@ -1,3 +1,9 @@
module.exports = {
+ build: {
+ postcss: [
+ require('tailwindcss')('./tailwind.js'),
+ require('autoprefixer')
+ ]
+ },
css: ['~/assets/css/tailwind.css']
}
diff --git a/lib/builder/builder.js b/lib/builder/builder.js
index 67f0217765..3e37d24470 100644
--- a/lib/builder/builder.js
+++ b/lib/builder/builder.js
@@ -668,11 +668,15 @@ module.exports = class Builder {
.on('unlink', refreshFiles)
// Watch for custom provided files
- const watchFiles = _.map(_.uniq(this.options.build.watch), p =>
+ let customPatterns = _.concat(
+ this.options.build.watch || [],
+ _.values(_.omit(this.options.build.styleResources, 'options'))
+ )
+ customPatterns = _.map(_.uniq(customPatterns), p =>
upath.normalizeSafe(p)
)
this.customFilesWatcher = chokidar
- .watch(watchFiles, options)
+ .watch(customPatterns, options)
.on('change', refreshFiles)
}
diff --git a/lib/core/module.js b/lib/core/module.js
index 7dc6d904bd..e79e3f6db2 100755
--- a/lib/core/module.js
+++ b/lib/core/module.js
@@ -71,6 +71,13 @@ module.exports = class ModuleContainer {
})
}
+ addLayout(template, name) {
+ const { dst, src } = this.addTemplate(template)
+
+ // Add to nuxt layouts
+ this.options.layouts[name || path.parse(src).name] = `./${dst}`
+ }
+
addServerMiddleware(middleware) {
this.options.serverMiddleware.push(middleware)
}
diff --git a/package.json b/package.json
index 47018f0ccd..dc20c959fd 100644
--- a/package.json
+++ b/package.json
@@ -61,13 +61,13 @@
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-vue-app": "^2.0.0",
- "caniuse-lite": "^1.0.30000792",
- "chalk": "^2.3.0",
- "chokidar": "^2.0.0",
+ "caniuse-lite": "^1.0.30000808",
+ "chalk": "^2.3.1",
+ "chokidar": "^2.0.1",
"clone": "^2.1.1",
"compression": "^1.7.1",
"connect": "^3.6.5",
- "css-hot-loader": "^1.3.6",
+ "css-hot-loader": "^1.3.7",
"css-loader": "^0.28.9",
"debug": "^3.1.0",
"es6-promise": "^4.2.4",
@@ -90,7 +90,7 @@
"opencollective": "^1.0.3",
"postcss": "^6.0.17",
"postcss-cssnext": "^3.1.0",
- "postcss-import": "^11.0.0",
+ "postcss-import": "^11.1.0",
"postcss-import-resolver": "^1.1.0",
"postcss-loader": "^2.1.0",
"postcss-url": "^7.3.0",
@@ -98,7 +98,7 @@
"progress-bar-webpack-plugin": "^1.10.0",
"semver": "^5.5.0",
"serialize-javascript": "^1.4.0",
- "serve-static": "^1.13.1",
+ "serve-static": "^1.13.2",
"server-destroy": "^1.0.1",
"source-map": "^0.7.0",
"style-resources-loader": "^1.0.0",
@@ -107,14 +107,14 @@
"url-loader": "^0.6.2",
"vue": "^2.5.13",
"vue-loader": "^14.1.1",
- "vue-meta": "^1.4.2",
+ "vue-meta": "^1.4.3",
"vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.13",
"vue-template-compiler": "^2.5.13",
"vuex": "^3.0.1",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^2.10.0",
- "webpack-dev-middleware": "^2.0.4",
+ "webpack-dev-middleware": "^2.0.5",
"webpack-hot-middleware": "^2.21.0",
"webpack-node-externals": "^1.6.0"
},
@@ -125,7 +125,7 @@
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-istanbul": "^4.1.5",
"codecov": "^3.0.0",
- "copy-webpack-plugin": "^4.3.1",
+ "copy-webpack-plugin": "^4.4.1",
"cross-env": "^5.1.3",
"eslint": "^4.17.0",
"eslint-config-standard": "^11.0.0-beta.0",
@@ -144,8 +144,8 @@
"puppeteer": "^1.0.0",
"request": "^2.83.0",
"request-promise-native": "^1.0.5",
- "sinon": "^4.2.2",
- "uglify-js": "^3.3.9"
+ "sinon": "^4.3.0",
+ "uglify-js": "^3.3.10"
},
"collective": {
"type": "opencollective",
diff --git a/test/basic.ssr.csp.test.js b/test/basic.ssr.csp.test.js
index 1ae4f359e6..2cad0acee2 100644
--- a/test/basic.ssr.csp.test.js
+++ b/test/basic.ssr.csp.test.js
@@ -11,7 +11,7 @@ const url = route => 'http://localhost:' + port + route
const startCSPTestServer = async (t, csp) => {
const options = {
rootDir: resolve(__dirname, 'fixtures/basic'),
- buildDir: '.nuxt-ssr',
+ buildDir: '.nuxt-ssr-csp',
dev: false,
head: {
titleTemplate(titleChunk) {
diff --git a/test/fixtures/module/modules/basic/index.js b/test/fixtures/module/modules/basic/index.js
index aab03927b0..99428e1093 100755
--- a/test/fixtures/module/modules/basic/index.js
+++ b/test/fixtures/module/modules/basic/index.js
@@ -8,6 +8,9 @@ module.exports = function basicModule(options, resolve) {
// Add a plugin
this.addPlugin(path.resolve(__dirname, 'reverse.js'))
+ // Add a layout
+ this.addLayout(path.resolve(__dirname, 'layout.vue'))
+
// Extend build
this.extendBuild((config, { isClient, isServer }) => {
// Do nothing!
diff --git a/test/fixtures/module/modules/basic/layout.vue b/test/fixtures/module/modules/basic/layout.vue
new file mode 100644
index 0000000000..ed699cfa2f
--- /dev/null
+++ b/test/fixtures/module/modules/basic/layout.vue
@@ -0,0 +1,6 @@
+
+ Module Layouts
+