-
-
Save Nedlinin/75ace532e6008704d8ce11f2a9a9f7d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Gulpfile.js | |
const gulp = require("gulp"); | |
const rollup = require("rollup"); | |
const sourcemaps = require('gulp-sourcemaps'); | |
const nodeResolve = require('rollup-plugin-node-resolve'); | |
const commonjs = require("rollup-plugin-commonjs"); | |
const babel = require('rollup-plugin-babel'); | |
const replace = require('rollup-plugin-replace'); | |
gulp.task("scripts", function () { | |
return rollup.rollup({ | |
entry: "./src/js/main.js", | |
plugins: [ | |
replace({ | |
"process.env.NODE_ENV": '"development"' | |
}), | |
nodeResolve({ | |
main: true, | |
skip: [ "esri" ] // Let Dojo handle Esri | |
}), | |
commonjs({ | |
// non-CommonJS modules will be ignored, but you can also | |
// specifically include/exclude files | |
include: "node_modules/**" | |
}), | |
babel({ | |
exclude: "node_modules/**" | |
}) | |
] | |
}).then(function(bundle) { | |
bundle.write({ | |
format: "amd", // AMD is Dojo compatible | |
dest: "build/js/main.js", | |
sourceMap: true | |
}); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also made mods to index.html to support rollup