Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8544edb

Browse files
authored
feat(dist): publish packages as ESM rather than CJS @W-20496487 (#5639)
* feat: change packages to type: module* chore: don't lint .cjs fileswe don't use them* chore: convert `module.exports` to `export default`* chore: replace `__dirname` with `import.meta.dirname`* chore: use .cjs extension* chore: rename test command to match package* revert(wdio): change back to commonjs* chore: convert script to esm* chore: change `main` entrypoint from CJS to ESM* fix(esm): misc changes to support ESM-first* fix: still use CJS for bundling* feat: add package.json `exports`
1 parent70e51c4 commit8544edb

File tree

61 files changed

+272
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+272
-130
lines changed

‎commitlint.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: MIT
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
7-
module.exports={
7+
exportdefault{
88
rules:{
99
'body-leading-blank':[1,'always'],
1010
'footer-leading-blank':[1,'always'],

‎eslint.config.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export default tseslint.config(
189189
},
190190
},
191191
{
192-
files:['**/*.js','**/*.mjs','**/*.cjs'],
192+
files:['**/*.js','**/*.mjs'],
193193
...tseslint.configs.disableTypeChecked,
194194
},
195195

‎package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"type":"git",
88
"url":"https://github.com/salesforce/lwc.git"
99
},
10+
"type":"module",
1011
"scripts": {
1112
"prepare":"husky && yarn build",
1213
"lint":"eslint . --cache",
@@ -25,7 +26,7 @@
2526
"test:ci":"vitest run --coverage",
2627
"test:wtr":"nx test @lwc/integration-wtr",
2728
"test:hydration":"nx test:hydration @lwc/integration-wtr",
28-
"test:integration":"nx sauce @lwc/integration-wdio",
29+
"test:wdio":"nx sauce @lwc/integration-wdio",
2930
"test:performance":"nx test @lwc/perf-benchmarks",
3031
"test:performance:best":"nx test:best @lwc/perf-benchmarks",
3132
"test:performance:best:ci":"nx test:best:ci @lwc/perf-benchmarks",

‎packages/@lwc/aria-reflection/package.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,21 @@
2323
"url":"https://github.com/salesforce/lwc/issues"
2424
},
2525
"license":"MIT",
26+
"type":"module",
2627
"publishConfig": {
2728
"access":"public"
2829
},
2930
"volta": {
3031
"extends":"../../../package.json"
3132
},
32-
"main":"dist/index.cjs.js",
33+
"main":"dist/index.js",
3334
"module":"dist/index.js",
3435
"types":"dist/index.d.ts",
36+
"exports": {
37+
"types":"./dist/index.d.ts",
38+
"import":"./dist/index.js",
39+
"require":"./dist/index.cjs"
40+
},
3541
"files": [
3642
"dist/**/*.js",
3743
"dist/**/*.d.ts"

‎packages/@lwc/babel-plugin-component/package.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@
1919
"url":"https://github.com/salesforce/lwc/issues"
2020
},
2121
"license":"MIT",
22+
"type":"module",
2223
"publishConfig": {
2324
"access":"public"
2425
},
2526
"volta": {
2627
"extends":"../../../package.json"
2728
},
28-
"main":"dist/index.cjs.js",
29+
"main":"dist/index.js",
2930
"module":"dist/index.js",
3031
"types":"dist/index.d.ts",
32+
"exports": {
33+
"types":"./dist/index.d.ts",
34+
"import":"./dist/index.js",
35+
"require":"./dist/index.cjs"
36+
},
3137
"files": [
3238
"dist/**/*.js",
3339
"dist/**/*.d.ts"

‎packages/@lwc/babel-plugin-component/src/__tests__/index.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function transform(source: string, opts = {}) {
8181
describe('fixtures',()=>{
8282
testFixtureDir<TestConfig>(
8383
{
84-
root:path.resolve(__dirname,'fixtures'),
84+
root:path.resolve(import.meta.dirname,'fixtures'),
8585
pattern:'**/actual.js',
8686
ssrVersion:2,
8787
},

‎packages/@lwc/compiler/package.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@
1919
"url":"https://github.com/salesforce/lwc/issues"
2020
},
2121
"license":"MIT",
22+
"type":"module",
2223
"publishConfig": {
2324
"access":"public"
2425
},
2526
"volta": {
2627
"extends":"../../../package.json"
2728
},
28-
"main":"dist/index.cjs.js",
29+
"main":"dist/index.js",
2930
"module":"dist/index.js",
3031
"types":"dist/index.d.ts",
32+
"exports": {
33+
"types":"./dist/index.d.ts",
34+
"import":"./dist/index.js",
35+
"require":"./dist/index.cjs"
36+
},
3137
"files": [
3238
"dist/**/*.js",
3339
"dist/**/*.d.ts"

‎packages/@lwc/engine-core/package.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@
1919
"url":"https://github.com/salesforce/lwc/issues"
2020
},
2121
"license":"MIT",
22+
"type":"module",
2223
"publishConfig": {
2324
"access":"public"
2425
},
2526
"volta": {
2627
"extends":"../../../package.json"
2728
},
28-
"main":"dist/index.cjs.js",
29+
"main":"dist/index.js",
2930
"module":"dist/index.js",
3031
"types":"dist/index.d.ts",
32+
"exports": {
33+
"types":"./dist/index.d.ts",
34+
"import":"./dist/index.js",
35+
"require":"./dist/index.cjs"
36+
},
3137
"files": [
3238
"dist/**/*.js",
3339
"dist/**/*.d.ts"

‎packages/@lwc/engine-dom/package.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@
1919
"url":"https://github.com/salesforce/lwc/issues"
2020
},
2121
"license":"MIT",
22+
"type":"module",
2223
"publishConfig": {
2324
"access":"public"
2425
},
2526
"volta": {
2627
"extends":"../../../package.json"
2728
},
28-
"main":"dist/index.cjs.js",
29+
"main":"dist/index.js",
2930
"module":"dist/index.js",
3031
"types":"dist/index.d.ts",
32+
"exports": {
33+
"types":"./dist/index.d.ts",
34+
"import":"./dist/index.js",
35+
"require":"./dist/index.cjs"
36+
},
3137
"files": [
3238
"dist/**/*.js",
3339
"dist/**/*.d.ts"

‎packages/@lwc/engine-server/package.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@
1919
"url":"https://github.com/salesforce/lwc/issues"
2020
},
2121
"license":"MIT",
22+
"type":"module",
2223
"publishConfig": {
2324
"access":"public"
2425
},
2526
"volta": {
2627
"extends":"../../../package.json"
2728
},
28-
"main":"dist/index.cjs.js",
29+
"main":"dist/index.js",
2930
"module":"dist/index.js",
3031
"types":"dist/index.d.ts",
32+
"exports": {
33+
"types":"./dist/index.d.ts",
34+
"import":"./dist/index.js",
35+
"require":"./dist/index.cjs"
36+
},
3137
"files": [
3238
"dist/**/*.js",
3339
"dist/**/*.d.ts"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp