Skip to content

Commit

Permalink
added contentParser build target
Browse files Browse the repository at this point in the history
  • Loading branch information
jacamera committed Jul 14, 2021
1 parent ce17acd commit ada8b05
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
26 changes: 26 additions & 0 deletions build/targets/contentParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const
fs = require('fs'),
path = require('path');

const
project = require('../project'),
createBuild = require('../createBuild');

const package = JSON.parse(
fs
.readFileSync('./package.json')
.toString()
);

const build = createBuild({
path: 'common/contentParsing',
webpack: {
entry: path.posix.join(project.srcDir, 'common/contentParsing/parseDocumentContent.ts'),
fileName: `content-parser-${package['it.reallyread'].version.common.contentParser}.js`,
sourceMaps: false,
minify: false,
outputLibrary: 'contentParser'
}
});

module.exports = build;
16 changes: 15 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const
extension = require('./build/targets/extension'),
nativeClientReader = require('./build/targets/nativeClient/reader'),
nativeClientShareExtension = require('./build/targets/nativeClient/shareExtension'),
metadataParser = require('./build/targets/metadataParser');
metadataParser = require('./build/targets/metadataParser'),
contentParser = require('./build/targets/contentParser');

/**
* app
Expand Down Expand Up @@ -55,6 +56,16 @@ function buildProdBrowser() {
return client.build(project.env.prod);
}

/**
* contentParser
*/
function cleanDevContentParser() {
return contentParser.clean(project.env.dev);
}
function buildDevContentParser() {
return contentParser.build(project.env.dev);
}

/**
* embed
*/
Expand Down Expand Up @@ -178,6 +189,9 @@ module.exports = {
'build:stage:browser': buildStageBrowser,
'clean:prod:browser': cleanProdBrowser,
'build:prod:browser': buildProdBrowser,
'clean:dev:content-parser': cleanDevContentParser,
'build:dev:content-parser': buildDevContentParser,
'watch:dev:content-parser': contentParser.watch,
'clean:dev:embed': cleanDevEmbed,
'build:dev:embed': buildDevEmbed,
'watch:dev:embed': embed.watch,
Expand Down

0 comments on commit ada8b05

Please sign in to comment.