Added minified version.

This commit is contained in:
Sebastian Kupke 2019-03-22 13:48:42 +01:00
parent d1efeeffa6
commit b164de08a5
5 changed files with 3583 additions and 6 deletions

View File

@ -1,8 +1,33 @@
# iwmlib # iwmlib
## Install
Install the following dependencies globally
`npm i rollup gulp-cli -g`
and some dependencies locally
`npm i`
Be sure that Python 3 is installed on your system (for building the 3rd party library).
## Build ## Build
Be sure that Python 3 is installed (for building the 3rd party library) and that you have installed Rollupjs globally `npm i rollup -g`. To build the two iwmlib files type
`npm run build`
The files will be generated in the dist folder (iwmlib.js and iwmlib.pixi.js). If you want to watch the files for a continuously build type
`npm run watch`
To build the 3rd party library type
`npm run 3rdparty`
To create the minified version of the 3rd party library type
`npm run minify`
To build the two iwmlib files type `npm run build`. The files will be generated in the dist folder (iwmlib.js and iwmlib.pixi.js). If you want to watch the files for a continuously build type `npm run watch`.
To build the 3rd party library type `npm run 3rdparty`. The file will be generated in the dist folder (iwmlib.3rdparty.js).

1
dist/iwmlib.3rdparty.min.js vendored Normal file

File diff suppressed because one or more lines are too long

14
gulpfile.js Normal file
View File

@ -0,0 +1,14 @@
const {src, dest, parallel} = require('gulp');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
function minify() {
return src([
'dist/iwmlib.3rdparty.js'
], {sourcemaps: false})
.pipe(rename({extname: '.min.js'}))
.pipe(uglify())
.pipe(dest('dist'))
}
exports.default = parallel(minify);

3534
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,8 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build": "rollup --config ./rollup.config.js", "build": "rollup --config ./rollup.config.js",
"watch": "rollup --watch --config ./rollup.config.js", "watch": "rollup --watch --config ./rollup.config.js",
"3rdparty": "python3 ./lib/3rdparty/create_all_js.py" "3rdparty": "python3 ./lib/3rdparty/create_all_js.py",
"minify": "gulp"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -18,5 +19,9 @@
}, },
"author": "", "author": "",
"license": "LGPL-3.0-or-later", "license": "LGPL-3.0-or-later",
"devDependencies": {} "devDependencies": {
"gulp": "^4.0.0",
"gulp-rename": "^1.4.0",
"gulp-uglify": "^3.0.2"
}
} }