Skip to content

Commit

Permalink
Merge pull request #46 from ftes/feature/transpile-to-commonjs
Browse files Browse the repository at this point in the history
🔧 Transpile to commonjs modules in addition to es2015
  • Loading branch information
gertqin authored Dec 23, 2020
2 parents c104095 + 8e97d04 commit 5de05e4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
/lib
/commonjs
/example/build.js
/example/build.js.map
/example/build.js.map
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This is yet another package to introduce a simple type-safe class style syntax f

And make sure to have the `--experimentalDecorators` flag enabled.

Both a `commonjs` and a `esm` module build is published. If you have a webpack-based setup, it will use the `esm` modules by default.

## Usage

Vuex modules can be written using decorators as a class:
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
"name": "vuex-class-modules",
"version": "1.1.3",
"description": "Typescript class decorators for class-style vuex modules.",
"main": "lib/index.js",
"main": "commonjs/index.js",
"module": "lib/index.js",
"exports": {
".": {
"require": "./commonjs/index.js",
"default": "./lib/index.js"
}
},
"types": "lib/index.d.ts",
"files": [
"dist",
"lib"
],
"scripts": {
"test": "jest --config jestconfig.json",
"build": "tsc",
"build": "npm run build:es2015 && npm run build:commonjs",
"build:es2015": "tsc",
"build:commonjs": "tsc -m commonjs --outDir ./commonjs",
"lint": "tslint -p tsconfig.json --fix",
"example": "npm run build && webpack --config ./example/webpack.config.js",
"prepare": "npm run build",
Expand Down

0 comments on commit 5de05e4

Please sign in to comment.