@@ -29,8 +29,8 @@ const rebuild = async (asciidoctorCoreDependency, environments) => {
2929 compilerModule . compile ( asciidoctorCoreDependency , environments )
3030}
3131
32- const concat = ( message , files , destination ) => {
33- log . debug ( message )
32+ const concat = ( files , destination ) => {
33+ log . transform ( 'concat' , files . join ( ' + ' ) , destination )
3434 bfs . concatSync ( files , destination )
3535}
3636
@@ -51,8 +51,8 @@ const parseTemplateData = (data, templateModel) => {
5151 . join ( '\n' )
5252}
5353
54- const generateUMD = ( asciidoctorCoreTarget , environments ) => {
55- log . task ( 'generate UMD ' )
54+ const generateFlavors = ( asciidoctorCoreTarget , environments ) => {
55+ log . task ( 'generate flavors ' )
5656
5757 // Asciidoctor core + extensions
5858 const apiFiles = [
@@ -61,7 +61,7 @@ const generateUMD = (asciidoctorCoreTarget, environments) => {
6161 ]
6262
6363 const apiBundle = 'build/asciidoctor-api.js'
64- concat ( 'Asciidoctor API core + extensions' , apiFiles , apiBundle )
64+ concat ( apiFiles , apiBundle )
6565
6666 const packageJson = require ( '../../package.json' )
6767 const templateModel = {
@@ -72,6 +72,7 @@ const generateUMD = (asciidoctorCoreTarget, environments) => {
7272
7373 // Build a dedicated JavaScript file for each environment
7474 environments . forEach ( ( environment ) => {
75+ log . debug ( environment )
7576 const opalExtData = fs . readFileSync ( `build/opal-ext-${ environment } .js` , 'utf8' )
7677 const asciidoctorCoreData = fs . readFileSync ( asciidoctorCoreTarget , 'utf8' )
7778 let data
@@ -88,12 +89,10 @@ const generateUMD = (asciidoctorCoreTarget, environments) => {
8889 } )
8990 let templateFile
9091 let target = `build/asciidoctor-${ environment } .js`
91- if ( environment === 'browser' ) {
92- templateFile = 'src/template-asciidoctor-browser.js'
93- } else if ( environment === 'node' || environment === 'electron' ) {
92+ if ( environment === 'node' || environment === 'electron' ) {
9493 templateFile = 'src/template-asciidoctor-node.js'
9594 } else {
96- templateFile = 'src/template-asciidoctor-umd .js'
95+ templateFile = 'src/template-asciidoctor-browser .js'
9796 }
9897 templateModel [ '//{{asciidoctorCode}}' ] = asciidoctorData
9998 const content = parseTemplateFile ( templateFile , templateModel )
@@ -119,7 +118,7 @@ module.exports = class Builder {
119118 this . benchmarkBuildDir = path . join ( 'build' , 'benchmark' )
120119 this . examplesBuildDir = path . join ( 'build' , 'examples' )
121120 this . asciidocRepoBaseURI = 'https://raw.githubusercontent.com/asciidoc/asciidoc/d43faae38c4a8bf366dcba545971da99f2b2d625'
122- this . environments = [ 'umd' , ' node', 'graalvm' , 'browser' ]
121+ this . environments = [ 'node' , 'graalvm' , 'browser' ]
123122 this . asciidoctorCoreTarget = path . join ( 'build' , 'asciidoctor-core.js' )
124123 }
125124
@@ -144,7 +143,7 @@ module.exports = class Builder {
144143
145144 bfs . mkdirsSync ( 'build/css' )
146145 await rebuild ( asciidoctorCoreDependency , this . environments )
147- generateUMD ( this . asciidoctorCoreTarget , this . environments )
146+ generateFlavors ( this . asciidoctorCoreTarget , this . environments )
148147 await uglifyModule . uglify ( )
149148 log . success ( `Done in ${ process . hrtime ( start ) [ 0 ] } s` )
150149 }
0 commit comments