Merge pull request #3 from embark-framework/features/fix-umd-for-node

Features/fix umd for node
This commit is contained in:
Michael Bradley 2018-07-10 09:14:10 -05:00 committed by GitHub
commit a9e4f79ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 12 deletions

View File

@ -1,9 +1,11 @@
{ {
"comments": false,
"compact": false, "compact": false,
"presets": [ "ignore": ["src/browser.js"],
["@babel/env", {"targets": {"node": "8.11.3"}}]
],
"plugins": [ "plugins": [
"@babel/plugin-transform-runtime" "@babel/plugin-transform-runtime"
],
"presets": [
["@babel/env", {"targets": {"node": "8.11.3"}}]
] ]
} }

2
.gitignore vendored
View File

@ -8,6 +8,6 @@ package
embark.min.js embark.min.js
embarkjs-*.tgz embarkjs-*.tgz
TODO
NOTES NOTES
npm-debug.log npm-debug.log
TODO

View File

@ -10,12 +10,11 @@
"src" "src"
], ],
"scripts": { "scripts": {
"build": "npm run clean && npm run build-babel && npm run build-webpack", "babel": "babel --out-dir dist src",
"build-babel": "babel --ignore 'src/browser.js' --out-dir dist src", "build": "npm run clean && npm run babel && npm run webpack",
"build-webpack": "npm run webpack",
"clean": "rimraf dist embark.min.js embarkjs-*.tgz package", "clean": "rimraf dist embark.min.js embarkjs-*.tgz package",
"http-server": "http-server",
"prepare": "npm run build", "prepare": "npm run build",
"server": "http-server",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"webpack": "webpack" "webpack": "webpack"
}, },

View File

@ -388,7 +388,7 @@ EmbarkJS.Names.register = function(name, options) {
throw new Error('Name system provider not set; e.g EmbarkJS.Names.setProvider("ens")'); throw new Error('Name system provider not set; e.g EmbarkJS.Names.setProvider("ens")');
} }
return this.currentNameSystems.register(name, options); return this.currentNameSystems.register(name, options);
} };
EmbarkJS.Utils = { EmbarkJS.Utils = {
fromAscii: function (str) { fromAscii: function (str) {

View File

@ -1,6 +1,6 @@
const path = require('path'); const path = require('path');
const browser = { const standalone = {
entry: path.resolve(__dirname, 'src') + '/browser.js', entry: path.resolve(__dirname, 'src') + '/browser.js',
mode: 'production', mode: 'production',
module: { module: {
@ -25,6 +25,7 @@ const browser = {
// }, // },
output: { output: {
filename: 'embark.min.js', filename: 'embark.min.js',
globalObject: 'typeof self !== \'undefined\' ? self : this',
library: 'EmbarkJS', library: 'EmbarkJS',
libraryTarget: 'umd', libraryTarget: 'umd',
libraryExport: 'default', libraryExport: 'default',
@ -35,5 +36,5 @@ const browser = {
}; };
module.exports = [ module.exports = [
browser standalone
]; ];