Skip to content

Commit

Permalink
"target": "ES2021"
Browse files Browse the repository at this point in the history
  • Loading branch information
kawanet committed Aug 20, 2023
1 parent c6c616c commit e6fb491
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ all: $(ALL)
test: all mocha

clean:
/bin/rm -f $(ALL) build/*.js mappings/*.js src/*.js test/*.js mappings/cp932.json
/bin/rm -fr $(ALL) build/ mappings/*.js src/*.js test/*.js mappings/cp932.json

# ES2021 - ES Module
index.mjs: build/esm/iconv-cp932.bundle.js
cp $^ $@

# ES5 - CommonJS for browsers
public/iconv-cp932.min.js: build/es5/iconv-cp932.wrap.js
@mkdir -p public/
./node_modules/.bin/terser -c -m -o $@ -- $<
Expand All @@ -37,12 +39,15 @@ mappings/cp932.json: mappings/CP932.TXT mappings/make-table.js
mocha: test/*.js
./node_modules/.bin/mocha test

# ES5 - CommonJS
build/es5/%.js: src/%.ts
./node_modules/.bin/tsc -p tsconfig-es5.json

# ES2021 - ES Module
build/esm/%.js: src/%.ts
./node_modules/.bin/tsc -p tsconfig-esm.json

# ES2021 - CommonJS
%.js: %.ts
./node_modules/.bin/tsc -p tsconfig.json

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"build": "make",
"fixpack": "fixpack",
"prepack": "make clean all test",
"test": "make test"
"test": "make test",
"test-browser": "make && open browser/test.html"
},
"type": "commonjs",
"typings": "./iconv-cp932.d.ts"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig-esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"removeComments": false,
"skipLibCheck": true,
"strictNullChecks": false,
"target": "ES2020"
"target": "ES2021"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"removeComments": false,
"skipLibCheck": true,
"strictNullChecks": false,
"target": "ES2020"
"target": "ES2021"
}
}

0 comments on commit e6fb491

Please sign in to comment.