Skip to content

Commit

Permalink
bundle.css
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpurr committed Dec 22, 2017
1 parent 0cee4c8 commit 33b5857
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ npm run mock
* vue-router
* axios
* json-server // for mock
* mockjs
* CSS
* SASS
* PostCSS
* cssnext
* cssnext
* element-ui
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vue from 'vue';
import VueRouter from 'vue-router';

import 'normalize.css';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Expand Down
58 changes: 40 additions & 18 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ const path = require('path');
const url = require('url');

// const webpack = require('webpack');

// var ExtractTextPlugin = require('extract-text-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
// const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const publicPath = '';
Expand All @@ -19,17 +18,24 @@ module.exports = (options = {}) => ({
module: {
rules: [{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
// {
// loader: 'css-loader',
// options: {
// importLoaders: 1
// }
// },
'postcss-loader'
]
// use: [
// 'style-loader',
// 'css-loader',
// // {
// // loader: 'css-loader',
// // options: {
// // importLoaders: 1
// // }
// // },
// 'postcss-loader'
// ]
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader',
'postcss-loader'
]
})
// use: ExtractTextPlugin.extract({
// fallback: 'style-loader',
// use: [{
Expand All @@ -54,11 +60,27 @@ module.exports = (options = {}) => ({
// },
{
test: /\.scss$/,
loader: 'style!css!sass'
// loader: 'style!css!sass'
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader',
'postcss-loader',
'sass-loader'
]
})
},
{
test: /\.vue$/,
loader: 'vue-loader'
loader: 'vue-loader',
options: {
loaders: {
scss: ExtractTextPlugin.extract({
use: ['css-loader','postcss-loader','sass-loader'],
fallback: 'vue-style-loader'
})
}
}
},
{
test: /(\.jsx|\.js)$/,
Expand All @@ -80,8 +102,8 @@ module.exports = (options = {}) => ({
]
},
plugins: [
new CleanWebpackPlugin(['dist']),
// new ExtractTextPlugin('bundle.css'),
// new CleanWebpackPlugin(['dist']),
new ExtractTextPlugin('bundle.css'),
new HtmlWebpackPlugin({
title: 'DircleFeed',
template: 'src/index.html'
Expand Down

0 comments on commit 33b5857

Please sign in to comment.