Browse Source

Pull request #1428: QFX-1451 feat: 开放less常量修改

Merge in VISUAL/fineui from ~FAY/fineui:master to master

* commit 'b666122128253742a3035d8fd84118341df143c3':
  revert
  Revert "Pull request #1427: 无JIRA任务 整理一下"
  Revert "无JIRA任务 更新图标"
  QFX-1451 feat: 开放less常量修改
  无JIRA任务 更新图标
es6
fay 4 years ago
parent
commit
a25389abb8
  1. 81
      webpack/webpack.common.js

81
webpack/webpack.common.js

@ -1,10 +1,23 @@
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const autoprefixer = require("autoprefixer");
const path = require("path");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const autoprefixer = require('autoprefixer');
const path = require('path');
const fs = require('fs');
const dirs = require("./dirs");
const dirs = require('./dirs');
const attachments = require("./attachments");
const attachments = require('./attachments');
let lessVariables = {};
if (process.env.LESS_CONFIG_PATH) {
const lessConfigPath = path.isAbsolute(process.env.LESS_CONFIG_PATH)
? process.env.LESS_CONFIG_PATH
: path.resolve(__dirname, '../', process.env.LESS_CONFIG_PATH);
lessVariables = fs.existsSync(lessConfigPath)
? require(lessConfigPath) || {}
: {};
}
module.exports = {
entry: {
@ -17,8 +30,8 @@ module.exports = {
underscore: '_',
},
resolve: {
mainFields: ["module", "main"],
extensions: [".js", ".ts"],
mainFields: ['module', 'main'],
extensions: ['.js', '.ts'],
},
module: {
rules: [
@ -26,17 +39,20 @@ module.exports = {
test: /\.(js|ts)$/,
include: [dirs.NODE_MODULES, dirs.PRIVATE, dirs.TYPESCRIPT],
exclude: /node_modules(\/|\\)core-js/,
use: [{
loader: "babel-loader",
options: {
configFile: dirs.IE8_BABEL_CONFIG,
use: [
{
loader: 'babel-loader',
options: {
configFile: dirs.IE8_BABEL_CONFIG,
},
},
}, {
loader: "source-map-loader",
options: {
enforce: "pre",
{
loader: 'source-map-loader',
options: {
enforce: 'pre',
},
},
}],
],
},
{
test: /\.js$/,
@ -51,9 +67,9 @@ module.exports = {
],
use: [
{
loader: "source-map-loader",
loader: 'source-map-loader',
options: {
enforce: "pre",
enforce: 'pre',
},
},
],
@ -63,44 +79,49 @@ module.exports = {
include: [path.resolve(__dirname, '../', attachments.lodash)],
use: [
{
loader: "script-loader",
loader: 'script-loader',
},
],
},
{
test: path.resolve(__dirname, '../', attachments.fix),
use: [{
loader: 'expose-loader',
options: 'Fix',
}],
use: [
{
loader: 'expose-loader',
options: 'Fix',
},
],
},
{
test: path.resolve(__dirname, '../', attachments.fixIE),
use: [{
loader: 'expose-loader',
options: 'Fix',
}],
use: [
{
loader: 'expose-loader',
options: 'Fix',
},
],
},
{
test: /\.(css|less)$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
loader: 'css-loader',
options: {
url: false,
},
},
{
loader: "postcss-loader",
loader: 'postcss-loader',
options: {
plugins: [autoprefixer],
},
},
{
loader: "less-loader",
loader: 'less-loader',
options: {
relativeUrls: false,
modifyVars: lessVariables,
},
},
],

Loading…
Cancel
Save