Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add production build command #54

Open
lorensr opened this issue Dec 22, 2017 · 1 comment
Open

Add production build command #54

lorensr opened this issue Dec 22, 2017 · 1 comment

Comments

@lorensr
Copy link

lorensr commented Dec 22, 2017

npm run build since babel-node isn't meant for production use. My attempt is failing:

$ GLOBIGNORE="node_modules/*"; babel **/*.js -o build.js 
ReferenceError: [BABEL] data/chapters.js: Unknown option: /Users/me/gh/api-model/node_modules/babel-preset-env/lib/index.js.__esModule. Check out http://babeljs.io/docs/usage/options/ for more info
    at Logger.error (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/logger.js:39:11)
    at OptionManager.mergeOptions (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:267:20)
    at /usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:349:14
    at /usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:369:24
    at Array.map (native)
    at OptionManager.resolvePresets (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
    at OptionManager.mergePresets (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
    at OptionManager.mergeOptions (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
    at OptionManager.addConfig (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:207:10)
    at OptionManager.findConfigs (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:413:16)
"dev": "babel-node index.js",
"build": "rm build.js; babel -d/o something",
"start": "node build.js"
@tmeasday
Copy link
Owner

tmeasday commented Dec 28, 2017

We use this:

  "scripts": {
    "dev": "PORT=3007 DEBUG=index* babel-node index.js",
    "start": "node dist/server/index.js",
    "prebuild": "rm -rf ./dist",
    "build": "babel . -d dist --copy-files"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants