@@ -44,10 +44,9 @@ function createIndexHtml(path, appName) {
4444export const createIndexTsx = ( path , appName ) => {
4545 const filePath = `${ path } /${ appName } /src/index.tsx` ;
4646 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';
5150
5251ReactDOM.render(<App />, document.getElementById('root'));
5352 ` ;
@@ -71,7 +70,7 @@ export const createPackage = (path, appName) => {
7170 "scripts": {
7271 "start": "node server/server.js",
7372 "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"
7574 },
7675 "nodemonConfig": {
7776 "ignore": [
@@ -148,9 +147,6 @@ module.exports = {
148147 mode: status,
149148 devServer: {
150149 publicPath: '/build/',
151- // proxy: {
152- // '/testDev': 'http://localhost:3000',
153- // },
154150 },
155151
156152 module: {
@@ -207,7 +203,8 @@ export const createTsConfig = (path, appName) => {
207203 "noImplicitAny": true,
208204 "module": "commonjs",
209205 "target": "es6",
210- "jsx": "react"
206+ "jsx": "react",
207+ "allowSyntheticDefaultImports": true
211208 },
212209 "include": ["./src/**/*"]
213210}
@@ -271,9 +268,9 @@ app.get('/', (req, res) => {
271268 res.sendFile(path.join(__dirname, '../index.html'));
272269});
273270
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 /
277274` ;
278275 fs . writeFile ( filePath , data , err => {
279276 if ( err ) {
0 commit comments