Skip to content

Commit

Permalink
feat: build in to es module
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladas Tamoshaitis committed Apr 26, 2021
1 parent 94ecbcb commit 86e9eb7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 44 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transi
# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-react-intl

build:
rm -rf ./dist
./node_modules/.bin/fedx-scripts babel src --out-dir dist --source-maps --ignore **/*.test.jsx,**/*.test.js,**/setupTest.js --copy-files
@# --copy-files will bring in everything else that wasn't processed by babel. Remove what we don't want.
@find dist -name '*.test.js*' -delete
rm ./dist/setupTest.js
cp ./LICENSE ./dist/LICENSE
cp ./README.rst ./dist/README.rst
cp ./package.json ./dist/package.json


precommit:
npm run lint
npm audit
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"version": "0.1.0",
"description": "Special exams lib",
"main": "dist/index.js",
"type": "module",
"exports": {
"import": "./dist/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/edx/frontend-lib-special-exams.git"
Expand All @@ -12,7 +16,7 @@
],
"sideEffects": false,
"scripts": {
"build": "fedx-scripts webpack --config ./webpack.config.js",
"build": "make build",
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
"is-es5": "es-check es5 ./dist/*.js",
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
Expand Down
43 changes: 0 additions & 43 deletions webpack.config.js

This file was deleted.

0 comments on commit 86e9eb7

Please sign in to comment.