add a gradle build to build everything into a single file
This commit is contained in:
commit
3ec6c2fd27
15
.babelrc
Normal file
15
.babelrc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
[
|
||||||
|
"@babel/preset-env",
|
||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"esmodules": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
14
build.gradle
Normal file
14
build.gradle
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
plugins {
|
||||||
|
id "com.moowork.node" version "1.3.1"
|
||||||
|
id "com.moowork.gulp" version "1.2.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
// run npm install and install gulp when building
|
||||||
|
gulp_build.dependsOn 'installGulp'
|
||||||
|
gulp_build.dependsOn 'npmInstall'
|
||||||
|
|
||||||
|
task build() {}
|
||||||
|
|
||||||
|
// run gulp build on every build
|
||||||
|
build.dependsOn gulp_build
|
||||||
|
|
19
gulpfile.js
Normal file
19
gulpfile.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const gulp = require('gulp')
|
||||||
|
const concat = require('gulp-concat')
|
||||||
|
const babel = require('gulp-babel')
|
||||||
|
|
||||||
|
function defaultTask(cb) {
|
||||||
|
cb()
|
||||||
|
}
|
||||||
|
|
||||||
|
function build(callback) {
|
||||||
|
gulp.src('src/**/*.js', { sourcemaps: true})
|
||||||
|
.pipe(babel())
|
||||||
|
.pipe(concat('bundle.js'))
|
||||||
|
.pipe(gulp.dest('dist/'), { sourcemaps: '.'})
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.build = build
|
||||||
|
exports.default = defaultTask
|
||||||
|
|
4741
package-lock.json
generated
Normal file
4741
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
12
package.json
Normal file
12
package.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "spa-demo",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.8.0",
|
||||||
|
"@babel/preset-env": "^7.8.0",
|
||||||
|
"gulp": "^4.0.2",
|
||||||
|
"gulp-babel": "^8.0.0",
|
||||||
|
"gulp-concat": "^2.6.1"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user