@atomicsmash/compiler 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +11 -19
  2. package/package.json +3 -7
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { sep as pathSeparator, extname, resolve as resolvePath, } from "node:path";
3
3
  import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-webpack-plugin";
4
+ import browserslistToEsbuild from "browserslist-to-esbuild";
4
5
  import CopyPlugin from "copy-webpack-plugin";
5
6
  import cssNano from "cssnano";
7
+ import { EsbuildPlugin } from "esbuild-loader";
6
8
  import glob from "fast-glob";
7
- import postCSSIncreaseSpecificity from "postcss-increase-specificity";
8
- import postCSSContext from "postcss-plugin-context";
9
9
  import postCSSPresetEnv from "postcss-preset-env";
10
10
  import SVGSpritemapPlugin from "svg-spritemap-webpack-plugin";
11
11
  import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
@@ -71,12 +71,6 @@ const postCSSConfig = [
71
71
  "custom-media-queries": true,
72
72
  },
73
73
  }),
74
- postCSSContext({
75
- wordpressEditor: postCSSIncreaseSpecificity({
76
- repeat: 1,
77
- stackableRoot: ".is-root-container",
78
- }),
79
- }),
80
74
  ],
81
75
  ...(MODE === "production" ? [cssNano] : []),
82
76
  ];
@@ -122,18 +116,9 @@ const compiler = webpack({
122
116
  {
123
117
  test: /\.[jt]sx?$/,
124
118
  use: {
125
- loader: "babel-loader",
119
+ loader: "esbuild-loader",
126
120
  options: {
127
- presets: [
128
- "@babel/preset-typescript",
129
- [
130
- "@babel/preset-react",
131
- {
132
- runtime: "automatic",
133
- },
134
- ],
135
- "@babel/preset-env",
136
- ],
121
+ target: browserslistToEsbuild(),
137
122
  },
138
123
  },
139
124
  exclude: (file) => {
@@ -242,6 +227,13 @@ const compiler = webpack({
242
227
  }),
243
228
  ...vueConfig.plugin,
244
229
  ],
230
+ optimization: {
231
+ minimizer: [
232
+ new EsbuildPlugin({
233
+ target: browserslistToEsbuild(),
234
+ }),
235
+ ],
236
+ },
245
237
  });
246
238
  if (argv.watch) {
247
239
  const watching = compiler.watch({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atomicsmash/compiler",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "A universal compiler for all Atomic Smash projects.",
6
6
  "keywords": [
7
7
  "cli",
@@ -44,19 +44,15 @@
44
44
  "lint:types": "tsc"
45
45
  },
46
46
  "dependencies": {
47
- "@babel/preset-env": "^7.26.0",
48
- "@babel/preset-react": "^7.26.3",
49
- "@babel/preset-typescript": "^7.26.0",
50
47
  "@wordpress/dependency-extraction-webpack-plugin": "^6.15.0",
51
- "babel-loader": "^9.2.1",
48
+ "browserslist-to-esbuild": "^2.1.1",
52
49
  "copy-webpack-plugin": "^12.0.2",
53
50
  "css-loader": "^7.1.2",
54
51
  "cssnano": "^7.0.6",
52
+ "esbuild-loader": "^4.3.0",
55
53
  "fast-glob": "^3.3.2",
56
54
  "postcss": "^8.4.49",
57
- "postcss-increase-specificity": "^0.6.0",
58
55
  "postcss-loader": "^8.1.1",
59
- "postcss-plugin-context": "^2.0.0",
60
56
  "postcss-preset-env": "^10.1.3",
61
57
  "sass": "^1.83.1",
62
58
  "sass-loader": "^16.0.4",