Skip to content

Commit

Permalink
update rollup to latest, switch to terser from uglifyjs
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-bateman committed Aug 3, 2023
1 parent 208e5ea commit be26c5d
Show file tree
Hide file tree
Showing 5 changed files with 740 additions and 568 deletions.
2 changes: 1 addition & 1 deletion lib/abc/lazy/SlotTraitInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SlotTraitInfo extends TraitInfo {
}

getDefaultValue(): any {
if (this.defaultValueKind === -1) {
if (<number> this.defaultValueKind === -1) {
if (this.typeName === null) {
return undefined;
}
Expand Down
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"scripts": {
"rimraf": "rimraf",
"rollup": "rollup -c",
"uglifyjs": "uglifyjs ./bundle/awayfl-avm2.umd.js -o ./bundle/awayfl-avm2.umd.min.js --source-map \"content='./bundle/awayfl-avm2.umd.js.map'\" --mangle",
"tsc": "tsc --lib ES2015.Symbol,DOM,ScriptHost,ES5,ES2015,ES2015.Iterable",
"tsc": "tsc",
"tsc:build": "npm run tsc || exit 0",
"clean": "npm cache clean && npm run rimraf -- node_modules dist bundle",
"clean:dist": "npm run rimraf -- dist bundle",
Expand All @@ -25,7 +24,7 @@
"gitdiff": "git diff --quiet && git diff --cached --quiet",
"preversion": "npm run gitdiff && npm run eslint:commit || exit 0",
"prebuild": "npm run clean:dist",
"build": "npm run tsc:build && npm run rollup && npm run uglifyjs",
"build": "npm run tsc:build && npm run rollup",
"copyVersionToIndex": "node ./copyVersionToIndex && git add ./index.ts && git commit -m \"update version number in index.ts\"",
"version": "npm run copyVersionToIndex && npm run build",
"postversion": "git push && git push --tags && npm publish"
Expand All @@ -50,6 +49,9 @@
"@awayjs/stage": "^0.11.0",
"tslib": "^2.3.0"
},
"dependencies": {
"xregexp": "^4.4.0"
},
"devDependencies": {
"@awayfl/swf-loader": "^0.4.0",
"@awayjs/core": "^0.9.0",
Expand All @@ -59,19 +61,15 @@
"@awayjs/scene": "^0.13.0",
"@awayjs/stage": "^0.11.0",
"@awayjs/view": "^0.6.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-node-resolve": "^11.2.1",
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.4.1",
"eslint": "^7.11.0",
"rimraf": "^2.5.2",
"rollup": "^0.57.1",
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-includepaths": "^0.2.1",
"rollup-plugin-node-resolve": "^3.3.0",
"tslib": "^1.9.0",
"typescript": "^3.7.3",
"uglify-js": "^3.0.15"
},
"dependencies": {
"xregexp": "^4.4.0"
"rollup": "^2.79.1",
"tslib": "^2.3.0",
"typescript": "^4.9.5"
}
}
43 changes: 21 additions & 22 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
var includePaths = require('rollup-plugin-includepaths');
var commonjs = require('rollup-plugin-commonjs');
var nodeResolve = require('rollup-plugin-node-resolve');
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';

module.exports = {
export default {
input: './dist/index.js',
output: {
name: 'AwayflAvm1',
sourcemap: true,
format: 'umd',
file: './bundle/awayfl-avm2.umd.js',
name: 'AwayflAvm2',
globals: {
'@awayfl/swf-loader': 'AwayflSwfLoader',
'@awayjs/core': 'AwayjsCore',
'@awayjs/graphics': 'AwayjsGraphics',
'@awayjs/scene': 'AwayjsScene',
'@awayjs/stage': 'AwayjsStage',
'@awayjs/view': 'AwayjsView',
'@awayjs/renderer': 'AwayjsRenderer',
'@awayjs/graphics': 'AwayjsGraphics',
'@awayjs/materials': 'AwayjsMaterials',
'@awayjs/scene': 'AwayjsScene'
},
sourcemap: true,
format: 'umd',
file: './bundle/awayfl-avm2.umd.js'
},
external: [
'@awayfl/swf-loader',
'@awayjs/core',
'@awayjs/graphics',
'@awayjs/scene',
'@awayjs/stage',
'@awayjs/view',
'@awayjs/renderer',
'@awayjs/graphics',
'@awayjs/materials',
'@awayjs/scene'
],
plugins: [
nodeResolve({
jsnext: true,
main: true,
module: true
}),
commonjs({
namedExports: {
'blocks': './node_modules/xregexp/tools/output/blocks.js'
}
})
nodeResolve(),
commonjs(),
terser(),
]
};
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"compilerOptions": {
"lib": ["es2015.symbol", "dom", "scripthost", "es5", "es2015", "es2015.iterable"],
"target": "es5",
"module": "es2015",
"lib": ["DOM","ScriptHost", "ESNext"],
"moduleResolution": "node",
"noImplicitUseStrict": true,
"noEmitHelpers": true,
"importHelpers": true,
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"allowSyntheticDefaultImports": true
"outDir": "./dist",
"allowSyntheticDefaultImports": true
},
"files": [
"./index.ts"
Expand Down
Loading

0 comments on commit be26c5d

Please sign in to comment.