@@ -44,10 +44,9 @@ function createIndexHtml(path, appName) {
44
44
export const createIndexTsx = ( path , appName ) => {
45
45
const filePath = `${ path } /${ appName } /src/index.tsx` ;
46
46
const data = `
47
- import * as React from 'react';
48
- import * as ReactDOM from 'react-dom';
49
-
50
- import App from './components/App.tsx';
47
+ import React from 'react';
48
+ import ReactDOM from 'react-dom';
49
+ import App from './components/App';
51
50
52
51
ReactDOM.render(<App />, document.getElementById('root'));
53
52
` ;
@@ -71,7 +70,7 @@ export const createPackage = (path, appName) => {
71
70
"scripts": {
72
71
"start": "node server/server.js",
73
72
"build": "cross-env NODE_ENV=production webpack",
74
- "dev": "nodemon server/server.js & cross-env NODE_ENV=development webpack-dev-server --open "
73
+ "dev": "cross-env NODE_ENV=development webpack-dev-server"
75
74
},
76
75
"nodemonConfig": {
77
76
"ignore": [
@@ -148,9 +147,6 @@ module.exports = {
148
147
mode: status,
149
148
devServer: {
150
149
publicPath: '/build/',
151
- // proxy: {
152
- // '/testDev': 'http://localhost:3000',
153
- // },
154
150
},
155
151
156
152
module: {
@@ -207,7 +203,8 @@ export const createTsConfig = (path, appName) => {
207
203
"noImplicitAny": true,
208
204
"module": "commonjs",
209
205
"target": "es6",
210
- "jsx": "react"
206
+ "jsx": "react",
207
+ "allowSyntheticDefaultImports": true
211
208
},
212
209
"include": ["./src/**/*"]
213
210
}
@@ -271,9 +268,9 @@ app.get('/', (req, res) => {
271
268
res.sendFile(path.join(__dirname, '../index.html'));
272
269
});
273
270
274
- app.listen(3000 , () => {
275
- console.log('listening on port 3000 ');
276
- }); //listens on port 3000 -> http://localhost:3000 /
271
+ app.listen(8080 , () => {
272
+ console.log('listening on port 8080 ');
273
+ }); //listens on port 8080 -> http://localhost:8080 /
277
274
` ;
278
275
fs . writeFile ( filePath , data , err => {
279
276
if ( err ) {
0 commit comments