-
Notifications
You must be signed in to change notification settings - Fork 36
feat: add esm support #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"modules": false, | ||
"targets": { "node": "12" } | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
["@babel/plugin-proposal-class-properties"], | ||
["@babel/plugin-transform-react-jsx", { "pragma": "h" }] | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
process.env.PTL_SKIP_AUTO_CLEANUP = true; | ||
process.env.PTL_SKIP_AUTO_CLEANUP = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,21 @@ | |
"name": "@testing-library/preact", | ||
"version": "0.0.0-semantically-released", | ||
"description": "Simple and complete Preact DOM testing utilities that encourage good testing practices.", | ||
"main": "dist/index.js", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./types/index.d.ts", | ||
"import": "./dist/esm/index.js", | ||
"browser": "./dist/cjs/index.js" | ||
}, | ||
"./pure": { | ||
"types": "./pure.d.ts", | ||
"import": "./dist/esm/pure.js", | ||
"browser": "./dist/cjs/pure.js" | ||
Comment on lines
+10
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESM output as
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I realised a moment ago as well, we have to output these as mjs as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, apologies then! Thanks for doing all of this! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to apologize, was a very good shout, thanks 😄 |
||
} | ||
}, | ||
"license": "MIT", | ||
"author": "Rahim Alwer <[email protected]>", | ||
"homepage": "https://github.com/testing-library/preact-testing-library#readme", | ||
|
@@ -33,13 +46,16 @@ | |
"dist", | ||
"dont-cleanup-after-each.js", | ||
"pure.js", | ||
"types/index.d.ts" | ||
"types/index.d.ts", | ||
"pure.d.ts" | ||
], | ||
"scripts": { | ||
"toc": "doctoc README.md", | ||
"lint": "eslint src/**/*.js --fix", | ||
"clean": "rimraf dist", | ||
"build": " babel src --out-dir dist --ignore '**/__tests__/**,**/__mocks__/**'", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"build:cjs": "babel src --out-dir dist/cjs --config-file ./.babelrc --ignore '**/__tests__/**,**/__mocks__/**'", | ||
"build:esm": "babel src --no-babelrc --out-dir dist/esm --config-file ./.babelrc.esm.json --ignore '**/__tests__/**,**/__mocks__/**'", | ||
"test": "jest src/__tests__ ", | ||
"test:watch": "npm test --watch", | ||
"test:update": "npm test --updateSnapshot --coverage", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// Makes it so people can import from '@testing-library/preact/pure' | ||
module.exports = require('./dist/pure'); | ||
module.exports = require('./dist/pure') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is our supported version according to pkg.json