docusaurus-theme-openapi-docs 2.0.0-beta.0 → 2.0.0-beta.1

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.
package/lib/index.js CHANGED
@@ -27,9 +27,37 @@ function docusaurusThemeOpenAPI() {
27
27
  getTypeScriptThemePath() {
28
28
  return _path.default.resolve(__dirname, "..", "src", "theme");
29
29
  },
30
- configureWebpack() {
30
+ configureWebpack(_, isServer, utils) {
31
+ const {
32
+ getStyleLoaders
33
+ } = utils;
34
+ const isProd = process.env.NODE_ENV === "production";
31
35
  return {
32
- plugins: [new NodePolyfillPlugin()]
36
+ plugins: [new NodePolyfillPlugin()],
37
+ module: {
38
+ rules: [{
39
+ test: /\.s[ca]ss$/,
40
+ oneOf: [{
41
+ test: /\.module\.s[ca]ss$/,
42
+ use: [...getStyleLoaders(isServer, {
43
+ modules: {
44
+ localIdentName: isProd ? `[local]_[hash:base64:4]` : `[local]_[path][name]`,
45
+ exportOnlyLocals: isServer
46
+ },
47
+ importLoaders: 2,
48
+ sourceMap: !isProd
49
+ }), {
50
+ loader: require.resolve("sass-loader"),
51
+ options: {}
52
+ }]
53
+ }, {
54
+ use: [...getStyleLoaders(isServer, {}), {
55
+ loader: require.resolve("sass-loader"),
56
+ options: {}
57
+ }]
58
+ }]
59
+ }]
60
+ }
33
61
  };
34
62
  }
35
63
  };
package/lib-next/index.js CHANGED
@@ -20,9 +20,48 @@ export default function docusaurusThemeOpenAPI() {
20
20
  getTypeScriptThemePath() {
21
21
  return path.resolve(__dirname, "..", "src", "theme");
22
22
  },
23
- configureWebpack() {
23
+ configureWebpack(_, isServer, utils) {
24
+ const { getStyleLoaders } = utils;
25
+ const isProd = process.env.NODE_ENV === "production";
24
26
  return {
25
27
  plugins: [new NodePolyfillPlugin()],
28
+ module: {
29
+ rules: [
30
+ {
31
+ test: /\.s[ca]ss$/,
32
+ oneOf: [
33
+ {
34
+ test: /\.module\.s[ca]ss$/,
35
+ use: [
36
+ ...getStyleLoaders(isServer, {
37
+ modules: {
38
+ localIdentName: isProd
39
+ ? `[local]_[hash:base64:4]`
40
+ : `[local]_[path][name]`,
41
+ exportOnlyLocals: isServer,
42
+ },
43
+ importLoaders: 2,
44
+ sourceMap: !isProd,
45
+ }),
46
+ {
47
+ loader: require.resolve("sass-loader"),
48
+ options: {},
49
+ },
50
+ ],
51
+ },
52
+ {
53
+ use: [
54
+ ...getStyleLoaders(isServer, {}),
55
+ {
56
+ loader: require.resolve("sass-loader"),
57
+ options: {},
58
+ },
59
+ ],
60
+ },
61
+ ],
62
+ },
63
+ ],
64
+ },
26
65
  };
27
66
  },
28
67
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-theme-openapi-docs",
3
3
  "description": "OpenAPI theme for Docusaurus.",
4
- "version": "2.0.0-beta.0",
4
+ "version": "2.0.0-beta.1",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -51,7 +51,7 @@
51
51
  "buffer": "^6.0.3",
52
52
  "clsx": "^1.1.1",
53
53
  "crypto-js": "^4.1.1",
54
- "docusaurus-plugin-openapi-docs": "^2.0.0-beta.0",
54
+ "docusaurus-plugin-openapi-docs": "^2.0.0-beta.1",
55
55
  "docusaurus-plugin-sass": "^0.2.3",
56
56
  "file-saver": "^2.0.5",
57
57
  "immer": "^9.0.7",
@@ -76,5 +76,5 @@
76
76
  "engines": {
77
77
  "node": ">=14"
78
78
  },
79
- "gitHead": "ef8b94ff1654153646f3616afb17fab7e267c51f"
79
+ "gitHead": "adcd05075257f6d00321dc289445d0306306b7ee"
80
80
  }
package/src/index.ts CHANGED
@@ -28,9 +28,48 @@ export default function docusaurusThemeOpenAPI(): Plugin<void> {
28
28
  return path.resolve(__dirname, "..", "src", "theme");
29
29
  },
30
30
 
31
- configureWebpack() {
31
+ configureWebpack(_, isServer, utils) {
32
+ const { getStyleLoaders } = utils;
33
+ const isProd = process.env.NODE_ENV === "production";
32
34
  return {
33
35
  plugins: [new NodePolyfillPlugin()],
36
+ module: {
37
+ rules: [
38
+ {
39
+ test: /\.s[ca]ss$/,
40
+ oneOf: [
41
+ {
42
+ test: /\.module\.s[ca]ss$/,
43
+ use: [
44
+ ...getStyleLoaders(isServer, {
45
+ modules: {
46
+ localIdentName: isProd
47
+ ? `[local]_[hash:base64:4]`
48
+ : `[local]_[path][name]`,
49
+ exportOnlyLocals: isServer,
50
+ },
51
+ importLoaders: 2,
52
+ sourceMap: !isProd,
53
+ }),
54
+ {
55
+ loader: require.resolve("sass-loader"),
56
+ options: {},
57
+ },
58
+ ],
59
+ },
60
+ {
61
+ use: [
62
+ ...getStyleLoaders(isServer, {}),
63
+ {
64
+ loader: require.resolve("sass-loader"),
65
+ options: {},
66
+ },
67
+ ],
68
+ },
69
+ ],
70
+ },
71
+ ],
72
+ },
34
73
  };
35
74
  },
36
75
  };