Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update build target and version #6355

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @antv/g6-cli

## 0.0.2

### Patch Changes

- chore, feat, bugfix
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g6-cli",
"version": "0.0.1",
"version": "0.0.2",
"description": "Scaffolding Your Extension for G6",
"keywords": [
"antv",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/template-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"sourceMap": true,
"sourceRoot": "src",
"strict": true,
"target": "esnext",
"target": "ES6",
"types": ["@types/jest", "node"],
"paths": {
"@/*": ["./*"],
Expand Down
2 changes: 1 addition & 1 deletion packages/g6-extension-3d/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"peerDependencies": {
"@antv/g": "^6.0.13",
"@antv/g-canvas": "^2.0.4",
"@antv/g6": "^5.0.22"
"@antv/g6": "^5.0.23"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/g6-extension-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"styled-components": "^6.1.13"
},
"peerDependencies": {
"@antv/g6": "^5.0.22",
"@antv/g6": "^5.0.23",
"react": ">=16.8",
"react-dom": ">=16.8"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/g6/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g6

## 5.0.23

### Patch Changes

- chore, feat, bugfix

## 5.0.22

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g6/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g6",
"version": "5.0.22",
"version": "5.0.23",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down
2 changes: 1 addition & 1 deletion packages/g6/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '5.0.22';
export const version = '5.0.23';
27 changes: 27 additions & 0 deletions packages/site/docs/manual/feature-common/webpack4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```js
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
},
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{
test: /\.js$/,
loader: '@open-wc/webpack-import-meta-loader',
},
],
},
mode: 'production',
};
```
17 changes: 14 additions & 3 deletions packages/site/docs/manual/further-reading/bundle.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,21 @@ npx webpack

> The above configuration works with `"webpack": "^5.94.0"`, `"webpack-cli": "^5.1.4"`.

If your Webpack version is lower, you may need to add additional loaders:
:::error{title=Webpack4}
⚠️ It is strongly recommended that projects use Webpack 5. If you are using Webpack 4, follow the steps below to configure:

- `ts-loader`: Used to load TypeScript files
- `@babel/plugin-transform-class-properties`: Used to transform properties of TypeScript classes
1. Install the necessary dependencies: `babel-loader` (<9), `@babel/preset-env`, `@open-wc/webpack-import-meta-loader`

> If you are using TypeScript, you also need to install `ts-loader`.

```bash
npm install babel-loader@8 @babel/preset-env @open-wc/webpack-import-meta-loader --save-dev
```

2. Modify the `webpack.config.js` configuration:

<embed src="../feature-common/webpack4.md"></embed>
:::

## Bundle Project with Rollup

Expand Down
17 changes: 14 additions & 3 deletions packages/site/docs/manual/further-reading/bundle.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,21 @@ npx webpack

> 上述配置在:"webpack": "^5.94.0","webpack-cli": "^5.1.4" 可以正常工作。

如果你的 webpack 版本较低,可能需要添加额外的 loader:
:::error{title=Webpack4}
⚠️ 强烈建议项目使用 Webpack 5,如果你使用的是 Webpack 4,按以下步骤配置:

- `ts-loader`:用于加载 TypeScript 文件
- `@babel/plugin-transform-class-properties`:用于转换 TypeScript 类的属性
1. 安装相关依赖:babel-loader(<9)、@babel/preset-env、@open-wc/webpack-import-meta-loader

> 如果你使用的 typescript,还需要安装 ts-loader

```bash
npm install babel-loader@8 @babel/preset-env @open-wc/webpack-import-meta-loader --save-dev
```

2. 修改 `webpack.config.js` 配置:

<embed src="../feature-common/webpack4.md"></embed>
:::

## 使用 Rollup 打包项目

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "esnext",
"target": "ES6",
"types": ["node", "@types/jest"]
},
"exclude": ["node_modules"]
Expand Down
Loading