From 066d7024c5b461ed4e4b93c3650f8abd151a10a9 Mon Sep 17 00:00:00 2001 From: James Hush Date: Mon, 18 Sep 2017 17:24:39 -0700 Subject: [PATCH] feat(package.json): Export es modules Preserve import/export statements so users can take advantage of tree shaking Fixes #29 --- .gitignore | 1 + package.json | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ac9939d..e9cced1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +es/ node_modules/ lib/ dist/ diff --git a/package.json b/package.json index 501b885..8ad001d 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.3.0", "description": "A react display ad component using Google Publisher Tag", "main": "lib/index.js", + "jsnext:main": "es/index.js", "contributors": [ { "name": "NFL Engineering" @@ -97,6 +98,7 @@ "commit": "git-cz", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "build": "npm run clean && npm run compile", + "build:es": "BABEL_ENV=es babel --copy-files ./src -d es", "build:umd": "NODE_ENV=development webpack src/index.js dist/react-gpt.js", "build:umd:min": @@ -111,7 +113,7 @@ "npm run build && env BABEL_ENV=examples node examples/server/index.js", "pretest": "npm run build", "prepublish": - "npm run build && npm run build:umd && npm run build:umd:min", + "npm run build && npm run build:es && npm run build:umd && npm run build:umd:min", "test": "npm run lint && karma start", "update-apilist": "node ./scripts/updateAPIList.js" },