diff --git a/src/builder/builder.js b/src/builder/builder.js index c1945d3f0d..061d61ed0a 100644 --- a/src/builder/builder.js +++ b/src/builder/builder.js @@ -37,16 +37,6 @@ export default class Builder extends Tapable { this.webpackDevMiddleware = null this.webpackHotMiddleware = null - // Add extra loaders only if they are not already provided - 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 - } - _.defaultsDeep(this.options.build, extraDefaults) - // Mute stats on dev this.webpackStats = this.options.dev ? false : { chunks: false, @@ -406,31 +396,6 @@ export default class Builder extends Tapable { } } -const defaultsLoaders = [ - { - test: /\.(png|jpe?g|gif|svg)$/, - loader: 'url-loader', - query: { - limit: 1000, // 1KO - name: 'img/[name].[hash:7].[ext]' - } - }, - { - test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, - loader: 'url-loader', - query: { - limit: 1000, // 1 KO - name: 'fonts/[name].[hash:7].[ext]' - } - } -] - -const defaultsPostcss = [ - require('autoprefixer')({ - browsers: ['last 3 versions'] - }) -] - const STATUS = { INITIAL: 1, BUILD_DONE: 2, diff --git a/src/builder/webpack/base.config.js b/src/builder/webpack/base.config.js index 8fb8dbc652..5e35c1e503 100644 --- a/src/builder/webpack/base.config.js +++ b/src/builder/webpack/base.config.js @@ -17,6 +17,14 @@ import { styleLoader, extractStyles } from './helpers' export default function webpackBaseConfig ({ isClient, isServer }) { const nodeModulesDir = join(__dirname, '..', 'node_modules') + if (!Array.isArray(this.options.build.postcss)) { + this.options.build.postcss = [ + require('autoprefixer')({ + browsers: ['last 3 versions'] + }) + ] + } + const config = { devtool: this.options.dev ? 'cheap-module-source-map' : false, entry: {