I tried adding node seedApp.ts
in here before it tries to run my React app but I get Cannot use import statement outside a module
"web-dev-test-manually": "NODE_ENV=localApp node seedApp.ts && yarn lint && yarn copyData && yarn compile-server && yarn start-static-server & node_modules/.bin/webpack-dev-server -d --watch",
seedApp.ts
import { setupDatabase } from '../Database/SeedApp';
(async () => {
await setupDatabase(['appdev/seed.companies.sql', 'appdev/seed.crafters.sql']);
})();
2
Answers
Try using
require
instead ofimport
:You can add
node seedApp.ts
before your start script inpackage.json
For example, something like this should work.