chore(project): 添加项目配置文件和忽略规则

- 添加 Babel 配置文件支持 ES6+ 语法转换
- 添加 ESLint 忽略规则和配置文件
- 添加 Git 忽略规则文件
- 添加 Travis CI 配置文件
- 添加 1.4.2 版本变更日志文件
- 添加 Helm 图表辅助模板文件
- 添加 Helm 忽略规则文件
This commit is contained in:
2026-03-27 17:36:48 +08:00
commit c2453d6434
1703 changed files with 277582 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
const postcssPresetEnv = require('postcss-preset-env');
module.exports = {
plugins: [
postcssPresetEnv,
],
};

View File

@@ -0,0 +1,57 @@
const path = require('path');
const rules = [{
test: /\.js$/,
exclude: [
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, '../ggeditor/gg-editor-core/bundle.js'),
],
use: {
loader: 'babel-loader',
},
}, {
test: /\.less$/,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader',
options: {
modules: true,
camelCase: true,
importLoaders: 1,
localIdentName: '[local]--[hash:base64:5]',
},
}, {
loader: 'postcss-loader',
options: {
config: {
path: path.resolve(__dirname, './postcss.config.js'),
},
},
}, {
loader: 'less-loader',
}],
}, {
test: /\.css$/,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader',
}],
}];
const externals = {
react: {
root: 'React',
commonjs: 'react',
commonjs2: 'react',
amd: 'react',
},
};
module.exports = {
module: {
rules,
},
externals,
};

View File

@@ -0,0 +1,60 @@
const path = require('path');
const { merge } = require('lodash');
const baseConfig = require('./webpack.config.base');
const mode = 'development';
const entry = {
bundle: path.resolve(__dirname, '..', 'src/index.js'),
};
const alias = {
'gg-editor': path.resolve(__dirname, '..', 'ggeditor'),
};
const externals = {
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
'react-router-dom': {
root: 'ReactRouterDOM',
commonjs: 'react-router-dom',
commonjs2: 'react-router-dom',
amd: 'react-router-dom',
},
antd: {
root: 'antd',
commonjs: 'antd',
commonjs2: 'antd',
amd: 'antd',
},
};
const devtool = 'cheap-module-eval-source-map';
const devServer = {
contentBase: path.resolve(__dirname, '..', ''),
publicPath: '/dist',
disableHostCheck: true,
};
const output = {
path: path.resolve(__dirname, '..', 'dist'),
filename: '[name].js',
libraryTarget: 'umd',
};
module.exports = merge(baseConfig, {
mode,
entry,
resolve: {
alias,
},
externals,
devtool,
devServer,
output,
});

View File

@@ -0,0 +1,53 @@
const path = require('path');
const { merge } = require('lodash');
const baseConfig = require('./webpack.config.base');
const mode = 'production';
const entry = {
bundle: path.resolve(__dirname, '..', 'src/index.js'),
};
const alias = {
'gg-editor': path.resolve(__dirname, '..', 'ggeditor'),
};
const externals = {
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
'react-router-dom': {
root: 'ReactRouterDOM',
commonjs: 'react-router-dom',
commonjs2: 'react-router-dom',
amd: 'react-router-dom',
},
antd: {
root: 'antd',
commonjs: 'antd',
commonjs2: 'antd',
amd: 'antd',
},
};
const devtool = 'cheap-module-source-map';
const output = {
path: path.resolve(__dirname, '..', 'dist'),
filename: '[name].js',
libraryTarget: 'umd',
};
module.exports = merge(baseConfig, {
mode,
entry,
resolve: {
alias,
},
externals,
devtool,
output,
});