Skip to content

Commit

Permalink
add license and optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
peilingjiang committed Feb 24, 2022
1 parent 94b6951 commit 6b88a40
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 12 deletions.
4 changes: 3 additions & 1 deletion lib/p5.bezier.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions lib/p5.bezier.min.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*!
*
* @license
* p5bezier Version 0.2.8
* https://github.com/peilingjiang/p5.bezier
*
* Copyright 2018-2022 Peiling Jiang
* Available under MIT license
*
*/
1 change: 1 addition & 0 deletions lib/p5.bezier.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"husky": "^7.0.4",
"lint-staged": "^12.3.4",
"prettier": "^2.5.1",
"terser-webpack-plugin": "^5.3.1",
"webpack": "^5.69.1",
"webpack-cli": "^4.9.2"
},
Expand Down
12 changes: 1 addition & 11 deletions src/p5.bezier.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@ p5.bezier library by Peiling Jiang
*/

const p5bezierAccuracyListAll = [
0.2,
0.1,
0.05,
0.04,
0.02,
0.01,
0.008,
0.002,
0.001,
0.0005,
0.0001,
0.2, 0.1, 0.05, 0.04, 0.02, 0.01, 0.008, 0.002, 0.001, 0.0005, 0.0001,
]

let _canvas, _ctx, _dimension, _strict
Expand Down
28 changes: 28 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
const path = require('path')

const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')

const packageJSON = require('./package.json')

module.exports = {
mode: 'production',
entry: './src/p5.bezier.js',
output: {
path: path.resolve(__dirname, 'lib'),
filename: 'p5.bezier.min.js',
library: 'p5bezier',
libraryTarget: 'umd',
sourceMapFilename: 'p5.bezier.min.js.map',
},
devtool: 'source-map',
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
drop_console: true,
},
},
}),
new webpack.BannerPlugin(`
@license
${packageJSON.name} Version ${packageJSON.version}
https://github.com/peilingjiang/p5.bezier
Copyright 2018-${new Date().getFullYear()} Peiling Jiang
Available under MIT license
`),
],
},
}

0 comments on commit 6b88a40

Please sign in to comment.