mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 03:38:20 +08:00
fix: add alias for webpack and fix pre commit hook and add ci
This commit is contained in:
parent
e3a7b7979e
commit
1a5395dc2d
21
.travis.yml
Normal file
21
.travis.yml
Normal file
@ -0,0 +1,21 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "10"
|
||||
|
||||
env:
|
||||
- NODE_ENV=test
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- xvfb
|
||||
- libgconf-2-4
|
||||
|
||||
install:
|
||||
- export DISPLAY=':99.0'
|
||||
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
||||
- npm install
|
||||
|
||||
script:
|
||||
- npm run ci
|
@ -25,6 +25,7 @@
|
||||
"build:umd": "webpack --config webpack.config.js --mode production",
|
||||
"clean": "rimraf esm lib dist",
|
||||
"lint": "lint-staged",
|
||||
"tslint": "tslint -c tslint.json 'src/**/*.ts'",
|
||||
"test": "jest",
|
||||
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/",
|
||||
"coverage": "jest --coverage",
|
||||
@ -65,12 +66,13 @@
|
||||
"typedoc": "^0.15.0",
|
||||
"typedoc-plugin-markdown": "^2.2.11",
|
||||
"typescript": "^3.5.3",
|
||||
"webpack": "^4.41.4",
|
||||
"webpack-cli": "^3.3.10",
|
||||
"event-simulate": "~1.0.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "run-s lint build test"
|
||||
"pre-commit": "run-s lint"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
|
@ -3,17 +3,20 @@ const resolve = require('path').resolve;
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
g6: './src/index.ts'
|
||||
g6: './src/index.ts',
|
||||
},
|
||||
output: {
|
||||
filename: '[name].min.js',
|
||||
library: 'G6',
|
||||
libraryTarget: 'umd',
|
||||
path: resolve(process.cwd(), 'dist/')
|
||||
path: resolve(process.cwd(), 'dist/'),
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@g6': resolve(process.cwd(), './src'),
|
||||
},
|
||||
// Add `.ts` as a resolvable extension.
|
||||
extensions: [ '.ts', '.js' ]
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@ -22,24 +25,21 @@ module.exports = {
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
babelrc: true
|
||||
}
|
||||
}
|
||||
babelrc: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
transpileOnly: true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
transpileOnly: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
new webpack.optimize.AggressiveMergingPlugin()
|
||||
],
|
||||
devtool: 'source-map'
|
||||
plugins: [new webpack.NoEmitOnErrorsPlugin(), new webpack.optimize.AggressiveMergingPlugin()],
|
||||
devtool: 'source-map',
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user