Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
💚 fix: css loader options spell error and remove some useless permission
Browse files Browse the repository at this point in the history
  • Loading branch information
tjx666 committed Nov 25, 2019
1 parent 31b7d6a commit 2c52f49
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 36 deletions.
50 changes: 16 additions & 34 deletions server/configs/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const entry = require('../utils/entry');

const projectRoot = resolve(__dirname, '../../');
const CSSLoaders = importLoaders => {
return [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { importLoaders } },
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [autoprefixer()],
},
},
];
};

module.exports = {
entry,
Expand Down Expand Up @@ -37,32 +50,12 @@ module.exports = {
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { constLoaders: 1 } },
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [autoprefixer()],
},
},
],
use: CSSLoaders(1),
},
{
test: /\.less$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [autoprefixer()],
},
},
...CSSLoaders(2),
{
loader: 'less-loader',
options: {
Expand All @@ -75,18 +68,7 @@ module.exports = {
},
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: [autoprefixer()],
},
},
'sass-loader',
],
use: [...CSSLoaders(2), 'sass-loader'],
},
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
Expand Down
1 change: 0 additions & 1 deletion server/configs/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const smp = new SpeedMeasurePlugin();

const prodConfig = merge.smart(common, {
mode: 'production',
devtool: 'source-map',
plugins: [
new BundleAnalyzerPlugin(),
new CopyPlugin([
Expand Down
1 change: 0 additions & 1 deletion src/manifest.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "牛客网 chrome 扩展",
"manifest_version": 2,
"permissions": ["webRequest", "storage", "notifications", "https://www.nowcoder.com/*"],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';",
"minimum_chrome_version": "68",
"background": {
"scripts": ["js/background.js"],
Expand Down

0 comments on commit 2c52f49

Please sign in to comment.