-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Size Limit | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- next | ||
|
||
jobs: | ||
size: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Size Limit | ||
run: npm run size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
const __DEV__ = process.env.NODE_ENV === 'development'; | ||
const filename = __DEV__ ? '[name].js' : '[name].min.js'; | ||
|
||
const plugins = [ | ||
new webpack.SourceMapDevToolPlugin({ | ||
filename: `${filename}.map` | ||
}) | ||
]; | ||
|
||
module.exports = { | ||
entry: { | ||
['rsuite-table']: path.join(__dirname, 'src') | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename, | ||
library: 'rsuite-table', | ||
libraryTarget: 'umd' | ||
}, | ||
externals: { | ||
react: { | ||
root: 'React', | ||
commonjs2: 'react', | ||
commonjs: 'react', | ||
amd: 'react' | ||
}, | ||
'react-dom': { | ||
root: 'ReactDOM', | ||
commonjs2: 'react-dom', | ||
commonjs: 'react-dom', | ||
amd: 'react-dom' | ||
} | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts|tsx?$/, | ||
use: ['babel-loader?babelrc'], | ||
exclude: /node_modules/ | ||
} | ||
] | ||
}, | ||
plugins, | ||
resolve: { | ||
extensions: ['.ts', '.tsx', '.js'] | ||
} | ||
}; |