makepack 1.0.4 → 1.0.5
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/package.json +1 -1
- package/src/actions/create/files/gitignore.js +1 -1
- package/src/actions/create/files/package-json.js +6 -2
- package/src/actions/create/files/project-react-js.js +5 -2
- package/src/actions/create/files/project-react-ts.js +5 -2
- package/src/actions/pack.js +1 -1
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -17,14 +17,18 @@ export default (args) => {
|
|
|
17
17
|
devDependencies["@types/react-dom"] = "^19.0.2"
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
let main = args.entry.split('.')
|
|
21
|
+
main.pop()
|
|
22
|
+
|
|
20
23
|
const json = {
|
|
21
24
|
name: args.diraname,
|
|
22
25
|
version: "1.0.0",
|
|
23
26
|
description: "",
|
|
24
|
-
main:
|
|
27
|
+
main: `./${main.join(".")}.js`,
|
|
25
28
|
scripts: {
|
|
26
29
|
"start": "makepack serve",
|
|
27
|
-
"
|
|
30
|
+
"pack": "makepack pack",
|
|
31
|
+
"publish": "makepack pack -p",
|
|
28
32
|
},
|
|
29
33
|
dependencies,
|
|
30
34
|
devDependencies,
|
|
@@ -18,8 +18,11 @@ const App = () => {
|
|
|
18
18
|
</div>
|
|
19
19
|
);
|
|
20
20
|
};
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const rootEle = document.getElementById('root')
|
|
22
|
+
if (rootEle) {
|
|
23
|
+
const root = createRoot(rootEle);
|
|
24
|
+
root.render(<App />);
|
|
25
|
+
}
|
|
23
26
|
`
|
|
24
27
|
return {
|
|
25
28
|
content,
|
|
@@ -18,8 +18,11 @@ const App: React.FC = () => {
|
|
|
18
18
|
</div>
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const rootEle = document.getElementById('root')
|
|
22
|
+
if (rootEle) {
|
|
23
|
+
const root = createRoot(rootEle);
|
|
24
|
+
root.render(<App />);
|
|
25
|
+
}
|
|
23
26
|
`
|
|
24
27
|
return {
|
|
25
28
|
content,
|
package/src/actions/pack.js
CHANGED
|
@@ -20,7 +20,7 @@ const pack = async (args) => {
|
|
|
20
20
|
outdir: path.join(process.cwd(), args.outdir),
|
|
21
21
|
minify: true,
|
|
22
22
|
sourcemap: true,
|
|
23
|
-
format: "
|
|
23
|
+
format: "cjs",
|
|
24
24
|
platform: 'node',
|
|
25
25
|
loader: { '.ts': 'ts' },
|
|
26
26
|
// tsconfig: path.join(process.cwd(), 'tsconfig.json'),
|
package/src/index.js
CHANGED