diff --git a/lib/build/index.js b/lib/build/index.js index 8a39f75992..ba32977e0a 100644 --- a/lib/build/index.js +++ b/lib/build/index.js @@ -43,7 +43,8 @@ const defaults = { vendor: [], loaders: [], plugins: [], - babel: {} + babel: {}, + postcss: [] } const defaultsLoaders = [ { @@ -63,14 +64,18 @@ const defaultsLoaders = [ } } ] +const defaultsPostcss = [ + require('autoprefixer')({ + browsers: ['last 3 versions'] + }) +] module.exports = function * () { // Defaults build options - if (this.options.build && Array.isArray(this.options.build.loaders)) { - this.options.build = _.defaultsDeep(this.options.build, defaults) - } else { - this.options.build = _.defaultsDeep(this.options.build, defaults, { loaders: defaultsLoaders }) - } + let extraDefaults = {} + if (this.options.build && !Array.isArray(this.options.build.loaders)) extraDefaults.loaders = defaultsLoaders + if (this.options.build && !Array.isArray(this.options.build.postcss)) extraDefaults.postcss = defaultsPostcss + this.options.build = _.defaultsDeep(this.options.build, defaults, extraDefaults) if (!this.options._build && !this.options._renderer) { return Promise.resolve() } diff --git a/lib/build/webpack/vue-loader.config.js b/lib/build/webpack/vue-loader.config.js index 95145678a1..c625d171eb 100644 --- a/lib/build/webpack/vue-loader.config.js +++ b/lib/build/webpack/vue-loader.config.js @@ -2,11 +2,7 @@ module.exports = function () { let config = { - postcss: [ - require('autoprefixer')({ - browsers: ['last 3 versions'] - }) - ], + postcss: this.options.build.postcss, loaders: { 'js': 'babel-loader?presets[]=es2015&presets[]=stage-2', 'postcss': 'vue-style-loader!css-loader', diff --git a/package.json b/package.json index 755a9e3f77..e9c5f6d800 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuxt", - "version": "0.6.6", + "version": "0.6.7", "description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)", "main": "index.js", "license": "MIT", @@ -9,8 +9,6 @@ "nuxt": "./bin/nuxt" }, "scripts": { - "start": "DEBUG=nuxt:* bin/nuxt", - "dev": "DEBUG=nuxt:* nodemon bin/nuxt", "test": "npm run lint", "lint": "eslint --ext .js,.vue bin lib pages test index.js --ignore-pattern lib/app", "precommit": "npm run lint"