Skip to content

Commit

Permalink
chore: set package type to module (#2334)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored May 14, 2024
1 parent 2edef9d commit 86b6464
Show file tree
Hide file tree
Showing 45 changed files with 151 additions and 151 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-assets-retry/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moduleTools from '@modern-js/module-tools';
import { moduleTools } from '@modern-js/module-tools';
import { buildConfigWithMjs } from '../../scripts/modern.base.config';

export default {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-assets-retry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-assets-retry"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"directory": "packages/plugin-babel"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-basic-ssl/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moduleTools from '@modern-js/module-tools';
import { moduleTools } from '@modern-js/module-tools';
import { buildConfigWithMjs } from '../../scripts/modern.base.config';

export default {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-basic-ssl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-basic-ssl"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-check-syntax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-check-syntax"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-css-minimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"directory": "packages/plugin-css-minimizer"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-eslint/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moduleTools from '@modern-js/module-tools';
import { moduleTools } from '@modern-js/module-tools';
import { buildConfigWithMjs } from '../../scripts/modern.base.config';

export default {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-eslint"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-image-compress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-image-compress"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-lightningcss/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moduleTools from '@modern-js/module-tools';
import { moduleTools } from '@modern-js/module-tools';
import { buildConfigWithMjs } from '../../scripts/modern.base.config';

export default {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-lightningcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"directory": "packages/plugin-lightningcss"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-lightningcss/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const applyLightningCSSLoader = ({
const rule = chain.module.rule(ruleId);
const use = rule.use(CHAIN_ID.USE.LIGHTNINGCSS);

use.loader(path.resolve(__dirname, './loader')).options(mergedOptions);
use.loader(path.resolve(__dirname, './loader.cjs')).options(mergedOptions);

switch (ruleId) {
case CHAIN_ID.RULE.SASS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should be configurable by us
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"cssModules": {
"dashedIdents": true,
Expand Down Expand Up @@ -76,7 +76,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should be configurable by us
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"cssModules": {
"dashedIdents": true,
Expand Down Expand Up @@ -137,7 +137,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should be configurable by us
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"cssModules": {
"dashedIdents": true,
Expand Down Expand Up @@ -246,7 +246,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should be configurable by us
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"targets": {
"chrome": 5701632,
Expand Down Expand Up @@ -282,7 +282,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should be configurable by us
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"targets": {
"chrome": 5701632,
Expand Down Expand Up @@ -331,7 +331,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should be configurable by us
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"targets": {
"chrome": 5701632,
Expand Down Expand Up @@ -422,7 +422,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should replace postcss-loade
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"targets": {
"chrome": 5701632,
Expand Down Expand Up @@ -458,7 +458,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should replace postcss-loade
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"targets": {
"chrome": 5701632,
Expand Down Expand Up @@ -507,7 +507,7 @@ exports[`plugins/lightningcss > plugin-lightningcss should replace postcss-loade
},
},
{
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader",
"loader": "<ROOT>/packages/plugin-lightningcss/src/loader.cjs",
"options": {
"targets": {
"chrome": 5701632,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-mdx/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moduleTools from '@modern-js/module-tools';
import { moduleTools } from '@modern-js/module-tools';
import { buildConfigWithMjs } from '../../scripts/modern.base.config';

export default {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-mdx"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-node-polyfill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-node-polyfill"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"directory": "packages/plugin-preact"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-pug/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moduleTools from '@modern-js/module-tools';
import { moduleTools } from '@modern-js/module-tools';
import { buildConfigWithMjs } from '../../scripts/modern.base.config';

export default {
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-pug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"directory": "packages/plugin-pug"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"directory": "packages/plugin-react"
},
"license": "MIT",
"type": "commonjs",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.js"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-rem/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moduleTools from '@modern-js/module-tools';
import { moduleTools } from '@modern-js/module-tools';
import { buildConfigWithMjs } from '../../scripts/modern.base.config';

export default {
Expand Down
Loading

0 comments on commit 86b6464

Please sign in to comment.