From 50cc0f1ea3d1d56f8228f4e021e29984b51265e5 Mon Sep 17 00:00:00 2001 From: cookfront Date: Fri, 24 Mar 2017 10:46:29 +0800 Subject: [PATCH] add docs css --- build/webpack.config.js | 18 ++++++++++++++++-- examples.html | 1 + index.html | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/build/webpack.config.js b/build/webpack.config.js index a9bbb70cf..55b9f0e16 100644 --- a/build/webpack.config.js +++ b/build/webpack.config.js @@ -7,6 +7,7 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin'); var version = require('../package.json').version; var getPoastcssPlugin = require('./utils/postcss_pipe'); var ProgressBarPlugin = require('progress-bar-webpack-plugin'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); function convert(str) { str = str.replace(/(&#x)(\w{4});/gi, function($0) { @@ -52,7 +53,17 @@ module.exports = { loaders: [ { test: /\.vue$/, - loader: 'vue-loader' + use: [{ + loader: 'vue-loader', + options: { + loaders: { + css: ExtractTextPlugin.extract({ + use: 'css-loader!postcss-loader', + fallback: 'vue-style-loader' + }) + } + } + }] }, { test: /\.js$/, @@ -61,7 +72,9 @@ module.exports = { }, { test: /\.css$/, - loader: 'style-loader!css-loader!postcss-loader' + use: ExtractTextPlugin.extract({ + use: 'css-loader!postcss-loader' + }) }, { test: /\.md/, @@ -76,6 +89,7 @@ module.exports = { devtool: 'source-map', plugins: [ new ProgressBarPlugin(), + new ExtractTextPlugin('[name].css'), new webpack.LoaderOptionsPlugin({ minimize: true, options: { diff --git a/examples.html b/examples.html index 09a80bd89..715ea4c4a 100644 --- a/examples.html +++ b/examples.html @@ -4,6 +4,7 @@ ZanUI + diff --git a/index.html b/index.html index 89dbb3016..d1cc2547b 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ ZanUI +