Commit 2604c619 authored by hetech's avatar hetech Committed by Zhi Cun

Chore: speeding up webpack (#14484)

* remove unsed dev dependencies

* chore: use latest css loaders & fix error

* remove postcss-nesting

* chore: remove postcss-loader

* upgrade copy-webpack-plugin
parent 969fdd26
......@@ -2,7 +2,6 @@ var path = require('path');
var fs = require('fs');
var nodeExternals = require('webpack-node-externals');
var Components = require('../components.json');
var saladConfig = require('./salad.config.json');
var utilsList = fs.readdirSync(path.resolve(__dirname, '../src/utils'));
var mixinsList = fs.readdirSync(path.resolve(__dirname, '../src/mixins'));
......@@ -48,12 +47,3 @@ exports.vue = {
};
exports.jsexclude = /node_modules|utils\/popper\.js|utils\/date.\js/;
exports.postcss = function(webapck) {
saladConfig.features.partialImport = {
addDependencyTo: webapck
};
return [
require('postcss-salad')(saladConfig)
];
};
{
"browsers": ["ie > 8", "last 2 versions"],
"features": {
"bem": {
"shortcuts": {
"component": "b",
"modifier": "m",
"descendent": "e"
},
"separators": {
"descendent": "__",
"modifier": "--"
}
}
}
}
......@@ -52,11 +52,7 @@ module.exports = {
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader', 'postcss-loader']
},
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
loaders: ['style-loader', 'css-loader']
},
{
test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
......
......@@ -47,11 +47,7 @@ const webpackConfig = {
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader', 'postcss-loader']
},
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
loaders: ['style-loader', 'css-loader']
},
{
test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
......
......@@ -35,7 +35,7 @@ module.exports = {
output: {
comments: false
}
},
}
})
]
},
......@@ -64,11 +64,7 @@ module.exports = {
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader', 'postcss-loader']
},
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
loaders: ['style-loader', 'css-loader']
},
{
test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
......
......@@ -84,16 +84,8 @@ const webpackConfig = {
}
},
{
test: /\.css$/,
loaders: [
isProd ? MiniCssExtractPlugin.loader : 'style-loader',
'css-loader',
'postcss-loader'
]
},
{
test: /\.scss$/,
loaders: [
test: /\.(scss|css)$/,
use: [
isProd ? MiniCssExtractPlugin.loader : 'style-loader',
'css-loader',
'sass-loader'
......
......@@ -22,7 +22,6 @@ const webpackConfig = {
}),
modules: ['node_modules']
},
devtool: '#inline-source-map',
module: {
rules: [
{
......@@ -42,7 +41,7 @@ const webpackConfig = {
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader', 'postcss-loader']
loaders: ['style-loader', 'css-loader']
},
{
test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/,
......
......@@ -84,9 +84,3 @@
}
};
</script>
<style>
@import 'highlight.js/styles/color-brewer.css';
@import 'assets/styles/common.css';
@import 'assets/styles/fonts/style.css';
</style>
......@@ -14,7 +14,7 @@ html, body {
#app {
height: 100%;
@when component {
&.is-component {
overflow-y: hidden;
.main-cnt {
......
......@@ -10,7 +10,7 @@
top: 0;
left: 0;
width: 100%;
line-height: @height;
line-height: 80px;
z-index: 100;
position: relative;
......
......@@ -127,7 +127,8 @@
.el-autocomplete-suggestion.my-autocomplete {
li {
line-height: normal;
padding: 7px *;
padding-top: 7px;
padding-bottom: 7px;
.name {
text-overflow: ellipsis;
......
......@@ -47,7 +47,8 @@
margin-left: 10px;
height: 32px;
line-height: 30px;
padding: 0 *;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
......
......@@ -26,13 +26,13 @@
font-size: 28px;
color: #8c939d;
width: 178px;
height: @width;
line-height: @height;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: @width;
height: 178px;
display: block;
}
}
......
......@@ -127,7 +127,8 @@
.el-autocomplete-suggestion.my-autocomplete {
li {
line-height: normal;
padding: 7px *;
padding-top: 7px;
padding-bottom: 7px;
.name {
text-overflow: ellipsis;
......
......@@ -47,7 +47,8 @@
margin-left: 10px;
height: 32px;
line-height: 30px;
padding: 0 *;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
......
......@@ -26,13 +26,13 @@
font-size: 28px;
color: #8c939d;
width: 178px;
height: @width;
line-height: @height;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: @width;
height: 178px;
display: block;
}
}
......
......@@ -47,7 +47,8 @@
margin-left: 10px;
height: 32px;
line-height: 30px;
padding: 0 *;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
......
......@@ -26,13 +26,13 @@
font-size: 28px;
color: #8c939d;
width: 178px;
height: @width;
line-height: @height;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: @width;
height: 178px;
display: block;
}
}
......
......@@ -158,7 +158,8 @@
.el-autocomplete-suggestion.my-autocomplete {
li {
line-height: normal;
padding: 7px *;
padding-top: 7px;
padding-bottom: 7px;
.name {
text-overflow: ellipsis;
......
......@@ -47,7 +47,8 @@
margin-left: 10px;
height: 32px;
line-height: 30px;
padding: 0 *;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
......
......@@ -26,13 +26,13 @@
font-size: 28px;
color: #8c939d;
width: 178px;
height: @width;
line-height: @height;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: @width;
height: 178px;
display: block;
}
}
......
......@@ -2,7 +2,6 @@ import Vue from 'vue';
import entry from './app';
import VueRouter from 'vue-router';
import Element from 'main/index.js';
import 'packages/theme-chalk/src/index.scss';
import routes from './route.config';
import demoBlock from './components/demo-block';
import MainFooter from './components/footer';
......@@ -11,6 +10,11 @@ import SideNav from './components/side-nav';
import FooterNav from './components/footer-nav';
import title from './i18n/title';
import 'packages/theme-chalk/src/index.scss';
import 'highlight.js/styles/color-brewer.css';
import './assets/styles/common.css';
import './assets/styles/fonts/style.css';
Vue.use(Element);
Vue.use(VueRouter);
Vue.component('demo-block', demoBlock);
......
......@@ -35,7 +35,7 @@
content: '';
display: inline-block;
width: 4px;
height: @width;
height: 4px;
border-radius: 50%;
vertical-align: middle;
background-color: #5e6d82;
......
......@@ -87,7 +87,7 @@
height: 42px;
width: 190px;
display: inline-block;
line-height: @height;
line-height: 42px;
font-size: 14px;
background-color: #409EFF;
color: #fff;
......
module.exports = {
plugins: {
'postcss-salad': {
browsers: ['ie > 8', 'last 2 versions'],
features: {
bem: {
shortcuts: {
component: 'b',
modifier: 'm',
descendent: 'e'
},
separators: {
descendent: '__',
modifier: '--'
}
}
}
}
}
};
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment