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