@plumeria/next-plugin 9.0.3 → 9.0.4
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 +16 -5
- package/dist/turbopack.js +17 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -35,16 +35,27 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.withPlumeria = withPlumeria;
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
|
+
const PLACEHOLDER = '/** Placeholder file */\n';
|
|
38
39
|
function withPlumeria(nextConfig) {
|
|
39
40
|
const VIRTUAL_FILE_PATH = require.resolve('@plumeria/turbopack-loader/zero-virtual.css');
|
|
41
|
+
const writeIfChanged = (path, content) => {
|
|
42
|
+
try {
|
|
43
|
+
const current = fs.readFileSync(path, 'utf-8');
|
|
44
|
+
if (current === content)
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
}
|
|
49
|
+
fs.writeFileSync(path, content, 'utf-8');
|
|
50
|
+
};
|
|
40
51
|
if (process.env.NODE_ENV === 'development') {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
process.on('SIGINT', () => {
|
|
53
|
+
writeIfChanged(VIRTUAL_FILE_PATH, PLACEHOLDER);
|
|
54
|
+
process.exit(0);
|
|
55
|
+
});
|
|
45
56
|
}
|
|
46
57
|
if (process.env.NODE_ENV === 'production') {
|
|
47
|
-
|
|
58
|
+
writeIfChanged(VIRTUAL_FILE_PATH, PLACEHOLDER);
|
|
48
59
|
}
|
|
49
60
|
const originalWebpack = nextConfig.webpack;
|
|
50
61
|
return {
|
package/dist/turbopack.js
CHANGED
|
@@ -5,22 +5,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.withPlumeria = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const PLACEHOLDER = '/** Placeholder file */\n';
|
|
8
9
|
const withPlumeria = (nextConfig = {}) => {
|
|
9
10
|
const VIRTUAL_FILE_PATH = require.resolve('@plumeria/turbopack-loader/zero-virtual.css');
|
|
11
|
+
const writeIfChanged = (path, content) => {
|
|
12
|
+
try {
|
|
13
|
+
const current = fs_1.default.readFileSync(path, 'utf-8');
|
|
14
|
+
if (current === content)
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
}
|
|
19
|
+
fs_1.default.writeFileSync(path, content, 'utf-8');
|
|
20
|
+
};
|
|
10
21
|
if (process.env.NODE_ENV === 'development') {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
process.on('SIGINT', () => {
|
|
23
|
+
writeIfChanged(VIRTUAL_FILE_PATH, PLACEHOLDER);
|
|
24
|
+
process.exit(0);
|
|
25
|
+
});
|
|
15
26
|
}
|
|
16
27
|
if (process.env.NODE_ENV === 'production') {
|
|
17
|
-
|
|
28
|
+
writeIfChanged(VIRTUAL_FILE_PATH, PLACEHOLDER);
|
|
18
29
|
}
|
|
19
30
|
const reactLoaders = [
|
|
20
|
-
{
|
|
21
|
-
loader: '@plumeria/turbopack-loader',
|
|
22
|
-
options: {},
|
|
23
|
-
},
|
|
31
|
+
{ loader: '@plumeria/turbopack-loader', options: {} },
|
|
24
32
|
];
|
|
25
33
|
return {
|
|
26
34
|
...nextConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/next-plugin",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "Plumeria Next.js plugin",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist/"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@plumeria/turbopack-loader": "^9.0.
|
|
36
|
+
"@plumeria/turbopack-loader": "^9.0.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"next": "^16.1.6",
|