create-plasmic-app 0.0.41 → 0.0.42
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/dist/index.js +0 -0
- package/dist/strategies/nextjs.js +14 -1
- package/package.json +1 -1
- package/src/strategies/nextjs.ts +16 -2
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -41,8 +41,8 @@ const nextjsStrategy = {
|
|
|
41
41
|
}),
|
|
42
42
|
overwriteConfig: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
43
|
const { projectPath, scheme } = args;
|
|
44
|
+
const nextjsConfigFile = path_1.default.join(projectPath, "next.config.js");
|
|
44
45
|
if (scheme === "codegen") {
|
|
45
|
-
const nextjsConfigFile = path_1.default.join(projectPath, "next.config.js");
|
|
46
46
|
yield fs_1.promises.writeFile(nextjsConfigFile, `
|
|
47
47
|
module.exports = {
|
|
48
48
|
eslint: {
|
|
@@ -53,6 +53,19 @@ module.exports = {
|
|
|
53
53
|
};
|
|
54
54
|
`);
|
|
55
55
|
}
|
|
56
|
+
else {
|
|
57
|
+
yield fs_1.promises.writeFile(nextjsConfigFile, `
|
|
58
|
+
/** @type {import('next').NextConfig} */
|
|
59
|
+
const nextConfig = {
|
|
60
|
+
// Turn off React StrictMode for now, as react-aria (used by Plasmic)
|
|
61
|
+
// has some troubles with it. See
|
|
62
|
+
// https://github.com/adobe/react-spectrum/labels/strict%20mode
|
|
63
|
+
reactStrictMode: false,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = nextConfig
|
|
67
|
+
`);
|
|
68
|
+
}
|
|
56
69
|
}),
|
|
57
70
|
generateFiles: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
71
|
// this is supposed to be called for loader case, so we are supposed to remove
|
package/package.json
CHANGED
package/src/strategies/nextjs.ts
CHANGED
|
@@ -36,9 +36,8 @@ const nextjsStrategy: CPAStrategy = {
|
|
|
36
36
|
},
|
|
37
37
|
overwriteConfig: async (args) => {
|
|
38
38
|
const { projectPath, scheme } = args;
|
|
39
|
-
|
|
39
|
+
const nextjsConfigFile = path.join(projectPath, "next.config.js");
|
|
40
40
|
if (scheme === "codegen") {
|
|
41
|
-
const nextjsConfigFile = path.join(projectPath, "next.config.js");
|
|
42
41
|
await fs.writeFile(
|
|
43
42
|
nextjsConfigFile,
|
|
44
43
|
`
|
|
@@ -51,6 +50,21 @@ module.exports = {
|
|
|
51
50
|
};
|
|
52
51
|
`
|
|
53
52
|
);
|
|
53
|
+
} else {
|
|
54
|
+
await fs.writeFile(
|
|
55
|
+
nextjsConfigFile,
|
|
56
|
+
`
|
|
57
|
+
/** @type {import('next').NextConfig} */
|
|
58
|
+
const nextConfig = {
|
|
59
|
+
// Turn off React StrictMode for now, as react-aria (used by Plasmic)
|
|
60
|
+
// has some troubles with it. See
|
|
61
|
+
// https://github.com/adobe/react-spectrum/labels/strict%20mode
|
|
62
|
+
reactStrictMode: false,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = nextConfig
|
|
66
|
+
`
|
|
67
|
+
)
|
|
54
68
|
}
|
|
55
69
|
},
|
|
56
70
|
generateFiles: async (args) => {
|