Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
BabelJS and other Yarn/NPM build script steps

Hello! I am curious about scripts (specifically build) in the package.json file when it comes to pushing an extension to production. Locally, I can:

yarn add @babel/core @babel/cli @babel/preset-env

and then update my package.json file to look like:

{
  "private": true,
  "scripts": {
    "test": "echo Frontend testing not configured",
    "test-cov": "echo Frontend testing coverage not configured",
    "lint": "echo Frontend linting not configured",
    "build": "rm -rf dist && mkdir dist && cp -r public/. dist/ && ./node_modules/.bin/babel ./public/js -d ./dist/js -s",
    "dev": "rm -rf dist && mkdir dist && cp -r public/. dist/"
  },
  "dependencies": {
    "@babel/cli": "^7.14.5",
    "@babel/core": "^7.14.6",
    "@babel/preset-env": "^7.14.7"
  }
}

I kick off the server using

q2 run

and I successfully have a babeled js directory and all seems good.

I just want to ensure that I follow the correct steps when it comes time to push this out to the PTE/production environments. Do I need to do anything special to ensure that babel is installed in the container or will the dependencies object in the package.json handle that automagically?

Thanks for any help in advance!

Posted 5 years ago
Votes Newest

Answers


The "contract" the build pipeline has with your app is that the it will go into all of your frontend directories and run 'yarn build'. yarn build can do whatever you want/need it to do. The only requirement is that all of your resulting JS/HTML/CSS files end up in the "dist" folder at the end.

Anything that happens between yarn build and the final output is up to you. If you need a specific NPM version, we use NVM so you can specificy a specific version using a .nvmrc file in your frontend directories.

wiki
Posted 5 years ago
Ryan Hollister
196 × 4 Administrator
0

Thank you, Ryan!

— Dan Collins   5 years ago