Merge branch 'release'
This commit is contained in:
commit
aca791c2a5
|
|
@ -29,7 +29,7 @@ const oakPathPlugin = require('../babel-plugin/oakPath');
|
||||||
|
|
||||||
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
|
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
|
||||||
const shouldAnalyze = process.env.COMPILE_ANALYZE === 'true';
|
const shouldAnalyze = process.env.COMPILE_ANALYZE === 'true';
|
||||||
const memoryLimit = process.env.MEMORY_LIMIT ? Number(process.env.MEMORY_LIMIT) : 4096;
|
const memoryLimit = process.env.MEMORY_LIMIT ? Number(process.env.MEMORY_LIMIT) : 8192;
|
||||||
|
|
||||||
const copyPatterns = [].concat(pkg.copyWebpack || []).map((pattern) =>
|
const copyPatterns = [].concat(pkg.copyWebpack || []).map((pattern) =>
|
||||||
typeof pattern === 'string'
|
typeof pattern === 'string'
|
||||||
|
|
@ -46,8 +46,9 @@ module.exports = function (webpackEnv) {
|
||||||
const isEnvStaging = webpackEnv === 'staging';
|
const isEnvStaging = webpackEnv === 'staging';
|
||||||
const isEnvDevelopment = webpackEnv === 'development';
|
const isEnvDevelopment = webpackEnv === 'development';
|
||||||
const isEnvProduction = webpackEnv === 'production';
|
const isEnvProduction = webpackEnv === 'production';
|
||||||
// 生产环境跟staging环境 shouldUseSourceMap为true 编译带上SourceMap
|
// 生产环境和staging 默认none,但命令加上--sourcemap时 使用source-map
|
||||||
const sourceMap = !isEnvDevelopment ? shouldUseSourceMap : isEnvDevelopment;
|
// 开发环境 使用eval-source-map
|
||||||
|
const sourceMap = isEnvDevelopment ? 'inline-source-map' : shouldUseSourceMap ? 'source-map' : false;
|
||||||
|
|
||||||
const oakFileLoader = (ext = '[ext]') => {
|
const oakFileLoader = (ext = '[ext]') => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -91,11 +92,7 @@ module.exports = function (webpackEnv) {
|
||||||
mode: isEnvStaging ? 'none' : (isEnvProduction ? 'production' : 'development'),
|
mode: isEnvStaging ? 'none' : (isEnvProduction ? 'production' : 'development'),
|
||||||
// Stop compilation early in production
|
// Stop compilation early in production
|
||||||
bail: !isEnvDevelopment,
|
bail: !isEnvDevelopment,
|
||||||
// 生产环境和staging 默认false,但命令加上--sourcemap时 使用source-map
|
devtool: sourceMap,
|
||||||
// 开发环境 使用cheap-module-source-map
|
|
||||||
devtool: !isEnvDevelopment
|
|
||||||
? (shouldUseSourceMap ? 'source-map' : false)
|
|
||||||
: 'cheap-module-source-map',
|
|
||||||
entry: {
|
entry: {
|
||||||
app: paths.appIndexJs,
|
app: paths.appIndexJs,
|
||||||
},
|
},
|
||||||
|
|
@ -129,7 +126,7 @@ module.exports = function (webpackEnv) {
|
||||||
const defaultFb = {
|
const defaultFb = {
|
||||||
crypto: require.resolve('crypto-browserify'),
|
crypto: require.resolve('crypto-browserify'),
|
||||||
buffer: require.resolve('safe-buffer'),
|
buffer: require.resolve('safe-buffer'),
|
||||||
stream: require.resolve('stream-browserify'),
|
stream: false,
|
||||||
zlib: require.resolve('browserify-zlib'),
|
zlib: require.resolve('browserify-zlib'),
|
||||||
events: require.resolve('events/'),
|
events: require.resolve('events/'),
|
||||||
querystring: require.resolve('querystring-es3'),
|
querystring: require.resolve('querystring-es3'),
|
||||||
|
|
|
||||||
|
|
@ -231,9 +231,8 @@ module.exports = function (webpackEnv) {
|
||||||
bail: !isEnvDevelopment,
|
bail: !isEnvDevelopment,
|
||||||
// 生产环境和staging 默认false,但命令加上--sourcemap时 使用source-map
|
// 生产环境和staging 默认false,但命令加上--sourcemap时 使用source-map
|
||||||
// 开发环境 使用cheap-module-source-map
|
// 开发环境 使用cheap-module-source-map
|
||||||
devtool: !isEnvDevelopment
|
devtool: isEnvDevelopment ? 'eval-source-map':
|
||||||
? (shouldUseSourceMap ? 'source-map' : false)
|
(shouldUseSourceMap ? 'source-map' : 'none'),
|
||||||
: 'cheap-module-source-map',
|
|
||||||
// These are the "entry points" to our application.
|
// These are the "entry points" to our application.
|
||||||
// This means they will be the "root" imports that are included in JS bundle.
|
// This means they will be the "root" imports that are included in JS bundle.
|
||||||
entry: paths.appIndexJs,
|
entry: paths.appIndexJs,
|
||||||
|
|
@ -714,10 +713,8 @@ module.exports = function (webpackEnv) {
|
||||||
'less-loader',
|
'less-loader',
|
||||||
{
|
{
|
||||||
lessOptions: () => {
|
lessOptions: () => {
|
||||||
const oakConfigJson = require(paths.oakConfigJson);
|
|
||||||
return {
|
return {
|
||||||
javascriptEnabled: true,
|
javascriptEnabled: true,
|
||||||
modifyVars: oakConfigJson.theme,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -738,10 +735,8 @@ module.exports = function (webpackEnv) {
|
||||||
'less-loader',
|
'less-loader',
|
||||||
{
|
{
|
||||||
lessOptions: () => {
|
lessOptions: () => {
|
||||||
const oakConfigJson = require(paths.oakConfigJson);
|
|
||||||
return {
|
return {
|
||||||
javascriptEnabled: true,
|
javascriptEnabled: true,
|
||||||
modifyVars: oakConfigJson.theme,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@xuchangzju/oak-cli",
|
"name": "@xuchangzju/oak-cli",
|
||||||
"version": "4.0.7",
|
"version": "4.0.8",
|
||||||
"description": "client for oak framework",
|
"description": "client for oak framework",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
@ -99,8 +99,8 @@
|
||||||
"mini-css-extract-plugin": "^2.5.3",
|
"mini-css-extract-plugin": "^2.5.3",
|
||||||
"node-watch": "^0.7.4",
|
"node-watch": "^0.7.4",
|
||||||
"oak-backend-base": "~4.1.1",
|
"oak-backend-base": "~4.1.1",
|
||||||
"oak-domain": "~5.0.9",
|
"oak-domain": "~5.0.11",
|
||||||
"oak-frontend-base": "~5.1.2",
|
"oak-frontend-base": "~5.2.3",
|
||||||
"parse-asn1": "5.1.6",
|
"parse-asn1": "5.1.6",
|
||||||
"postcss": "^8.4.4",
|
"postcss": "^8.4.4",
|
||||||
"postcss-flexbugs-fixes": "^5.0.2",
|
"postcss-flexbugs-fixes": "^5.0.2",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
"use oak router builder"; // 这行备注说明是用oak的router builder来生成allRouters
|
"use oak router builder"; // 这行备注说明是用oak的router builder来生成allRouters
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { IRouter } from '../../types/router';
|
import { IRouter } from 'oak-frontend-base/es/platforms/web/router/types';
|
||||||
let allRouters: IRouter[] = [];
|
let allRouters: IRouter[] = [];
|
||||||
export default allRouters;
|
export default allRouters;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue