@atomicsmash/compiler 0.3.0 → 0.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAoBA,OAAO,CAAC,MAAM,CAAC;IAEd,UAAU,MAAM,CAAC;QAEhB,UAAU,UAAU;YACnB,QAAQ,EAAE,YAAY,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;SAC5D;KACD;CACD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAsBA,OAAO,CAAC,MAAM,CAAC;IAEd,UAAU,MAAM,CAAC;QAEhB,UAAU,UAAU;YACnB,QAAQ,EAAE,YAAY,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;SAC5D;KACD;CACD"}
package/dist/index.js CHANGED
@@ -4,6 +4,8 @@ import DependencyExtractionWebpackPlugin from "@wordpress/dependency-extraction-
4
4
  import CopyPlugin from "copy-webpack-plugin";
5
5
  import cssNano from "cssnano";
6
6
  import glob from "fast-glob";
7
+ import postCSSIncreaseSpecificity from "postcss-increase-specificity";
8
+ import postCSSContext from "postcss-plugin-context";
7
9
  import postCSSPresetEnv from "postcss-preset-env";
8
10
  import SVGSpritemapPlugin from "svg-spritemap-webpack-plugin";
9
11
  import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
@@ -69,6 +71,12 @@ const postCSSConfig = [
69
71
  "custom-media-queries": true,
70
72
  },
71
73
  }),
74
+ postCSSContext({
75
+ wordpressEditor: postCSSIncreaseSpecificity({
76
+ repeat: 1,
77
+ stackableRoot: ".is-root-container",
78
+ }),
79
+ }),
72
80
  ],
73
81
  ...(MODE === "production" ? [cssNano] : []),
74
82
  ];
@@ -81,13 +89,10 @@ const compiler = webpack({
81
89
  },
82
90
  devtool: MODE === "development" ? "source-map" : false,
83
91
  mode: MODE,
84
- experiments: {
85
- outputModule: true,
86
- },
87
92
  entry: await glob([
88
- `${srcFolder}/js/*.{js,ts}`,
93
+ `${srcFolder}/js/*.{js,ts,jsx,tsx}`,
89
94
  `${srcFolder}/css/*.css`,
90
- `${srcFolder}/css/*.s[ac]ss`,
95
+ `${srcFolder}/css/**/[^_]*.s[ac]ss`,
91
96
  ]).then((paths) => {
92
97
  const entryPoints = {};
93
98
  paths.forEach((path) => {
@@ -103,10 +108,8 @@ const compiler = webpack({
103
108
  filename: "js/[name].[contenthash].js",
104
109
  clean: true,
105
110
  library: {
106
- type: "modern-module",
111
+ type: "umd",
107
112
  },
108
- libraryTarget: "module",
109
- module: true,
110
113
  path: distFolder,
111
114
  },
112
115
  resolve: {
@@ -121,7 +124,16 @@ const compiler = webpack({
121
124
  use: {
122
125
  loader: "babel-loader",
123
126
  options: {
124
- presets: ["@babel/preset-typescript", "@babel/preset-env"],
127
+ presets: [
128
+ "@babel/preset-typescript",
129
+ [
130
+ "@babel/preset-react",
131
+ {
132
+ runtime: "automatic",
133
+ },
134
+ ],
135
+ "@babel/preset-env",
136
+ ],
125
137
  },
126
138
  },
127
139
  exclude: (file) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atomicsmash/compiler",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "description": "A universal compiler for all Atomic Smash projects.",
6
6
  "keywords": [
7
7
  "cli",
@@ -53,7 +53,9 @@
53
53
  "cssnano": "^7.0.6",
54
54
  "fast-glob": "^3.3.2",
55
55
  "postcss": "^8.4.49",
56
+ "postcss-increase-specificity": "^0.6.0",
56
57
  "postcss-loader": "^8.1.1",
58
+ "postcss-plugin-context": "^2.0.0",
57
59
  "postcss-preset-env": "^10.1.3",
58
60
  "sass": "^1.83.1",
59
61
  "sass-loader": "^16.0.4",