Skip to content

Commit

Permalink
Revert "chore: Add an ESM submodule export to the build output (#1129)"
Browse files Browse the repository at this point in the history
This reverts commit e0b66f7.
  • Loading branch information
jmuzina committed Sep 26, 2024
1 parent 4872eaf commit 4ae2d89
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 77 deletions.
24 changes: 24 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"babel-plugin-typescript-to-proptypes",
[
"module-resolver",
{
"root": ["./src"],
"alias": {
"enums": "./src/enums",
"components": "./src/components",
"hooks": "./src/hooks",
"types": "./src/types",
"utils": "./src/utils"
}
}
]
]
}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
node_modules
dist
dist-esm
dist-types
.env.local
.DS_Store
.idea
Expand Down
3 changes: 1 addition & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ const config = {
"@storybook/addon-docs",
"@storybook/addon-controls",
"@storybook/addon-a11y",
"@storybook/addon-webpack5-compiler-babel",
"@storybook/addon-webpack5-compiler-babel"
],
webpackFinal: async (config) => {
process.env.BABEL_ENV = "cjs";
config.module.rules.push({
test: /\.scss$/,
use: ["style-loader", "css-loader", "sass-loader"],
Expand Down
65 changes: 0 additions & 65 deletions babel.config.js

This file was deleted.

13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"name": "@canonical/react-components",
"version": "0.47.3",
"main": "dist/index.js",
"module": "dist-esm/index.js",
"types": "dist-types/index.d.ts",
"module": "dist/index.js",
"author": {
"email": "webteam@canonical.com",
"name": "Canonical Webteam"
Expand Down Expand Up @@ -129,12 +128,10 @@
"vanilla-framework": "^3.15.1 || ^4.0.0"
},
"scripts": {
"build": "yarn build-cjs && yarn build-declaration && yarn build-esm",
"build-base": "rm -rf $OUT_DIR && NODE_ENV=production BABEL_ENV=$BABEL_ENV babel src --out-dir $OUT_DIR --copy-files --no-copy-ignored --extensions '.js,.jsx,.ts,.tsx,.snap' --ignore '**/*.test.ts','**/*.test.tsx','**/*.stories.tsx','**/__snapshots__','src/setupTests.js','src/testing'",
"build-cjs": "OUT_DIR=dist BABEL_ENV=cjs yarn run build-base",
"build-esm": "OUT_DIR=dist-esm BABEL_ENV=esm yarn run build-base",
"build-declaration": "rm -rf dist-types && tsc --project tsconfig.build.json --outDir dist-types && tsc-alias -p tsconfig.build.json --outDir dist-types",
"build-watch": "yarn run build-cjs --watch",
"build": "rm -rf dist && yarn build-local; yarn build-declaration",
"build-local": "NODE_ENV=production babel src --out-dir dist --copy-files --no-copy-ignored --extensions '.js,.jsx,.ts,.tsx,.snap' --ignore '**/*.test.ts','**/*.test.tsx','**/*.stories.tsx','**/__snapshots__','src/setupTests.js','src/testing'",
"build-declaration": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"build-watch": "yarn run build-local --watch",
"build-docs": "storybook build -c .storybook -o docs",
"clean": "rm -rf node_modules dist .out",
"docs": "storybook dev -p ${PORT:-9009} --no-open",
Expand Down

0 comments on commit 4ae2d89

Please sign in to comment.