Skip to content

Commit

Permalink
Merge pull request #234 from mgusmano/ext-react-6.7.x
Browse files Browse the repository at this point in the history
plugin
  • Loading branch information
mgusmano authored Mar 4, 2019
2 parents 37fee85 + b855b6b commit 935456f
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 69 deletions.
9 changes: 7 additions & 2 deletions packages/ext-react-webpack-plugin/dist/artifacts.js

Large diffs are not rendered by default.

77 changes: 38 additions & 39 deletions packages/ext-react-webpack-plugin/dist/pluginUtil.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/ext-react-webpack-plugin/src/artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,15 @@ export function createAppJson( theme, packages, toolkit, options, output ) {
"overrides",
"jsdom-environment.js"
],
// "language": {
// "js": {
// "output": "ES5"
// }
// },
"packages": {
"dir": [
nodeModulePath + "node_modules/@sencha",
nodeModulePath + "ext-react/packages"
nodeModulePath + toolkit + "/packages"
]
},
output: {
Expand Down
52 changes: 25 additions & 27 deletions packages/ext-react-webpack-plugin/src/pluginUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,30 @@ export function _compilation(compiler, compilation, vars, options) {
compilation.hooks.htmlWebpackPluginBeforeHtmlGeneration.tap(`ext-html-generation`,(data) => {
logv(options,'HOOK ext-html-generation')
const path = require('path')
var outputPath = ''
if (compiler.options.devServer) {
if (compiler.outputPath === '/') {
outputPath = path.join(compiler.options.devServer.contentBase, outputPath)
}
else {
if (compiler.options.devServer.contentBase == undefined) {
outputPath = 'build'
}
else {
outputPath = ''
}
}
}
else {
outputPath = 'build'
}
outputPath = outputPath.replace(process.cwd(), '').trim()
var jsPath = path.join(outputPath, vars.extPath, 'ext.js')
var cssPath = path.join(outputPath, vars.extPath, 'ext.css')

//var outputPath = ''
// if (compiler.options.devServer) {
// if (compiler.outputPath === '/') {
// outputPath = path.join(compiler.options.devServer.contentBase, outputPath)
// }
// else {
// if (compiler.options.devServer.contentBase == undefined) {
// outputPath = 'build'
// }
// else {
// outputPath = ''
// }
// }
// }
// else {
// outputPath = 'build'
// }
// outputPath = outputPath.replace(process.cwd(), '').trim()
//var jsPath = path.join(outputPath, vars.extPath, 'ext.js')
//var cssPath = path.join(outputPath, vars.extPath, 'ext.css')

var jsPath = path.join(vars.extPath, 'ext.js')
var cssPath = path.join(vars.extPath, 'ext.css')
data.assets.js.unshift(jsPath)
data.assets.css.unshift(cssPath)
log(vars.app + `Adding ${jsPath} and ${cssPath} to index.html`)
Expand Down Expand Up @@ -208,7 +212,6 @@ export async function emit(compiler, compilation, vars, options, callback) {
await _buildExtBundle(app, compilation, outputPath, parms, options)
vars.watchStarted = true
}

callback()
}
else {
Expand Down Expand Up @@ -301,9 +304,8 @@ export function _prepareForBuild(app, vars, options, output, compilation) {
log(app + 'Building Ext bundle at: ' + bundleDir)
}
else {
vars.rebuild = true
vars.rebuild = false
log(app + 'Ext rebuild NOT needed')
log(app + 'but done')
}
}
catch(e) {
Expand Down Expand Up @@ -384,7 +386,6 @@ export function _done(vars, options) {

//**********
export async function executeAsync (app, command, parms, opts, compilation, options) {

try {
//const DEFAULT_SUBSTRS = ['[INF] Loading', '[INF] Processing', '[LOG] Fashion build complete', '[ERR]', '[WRN]', "[INF] Server", "[INF] Writing", "[INF] Loading Build", "[INF] Waiting", "[LOG] Fashion waiting"];
const DEFAULT_SUBSTRS = ["[INF] xServer", '[INF] Loading', '[INF] Append', '[INF] Processing', '[INF] Processing Build', '[LOG] Fashion build complete', '[ERR]', '[WRN]', "[INF] Writing", "[INF] Loading Build", "[INF] Waiting", "[LOG] Fashion waiting"];
Expand Down Expand Up @@ -419,9 +420,6 @@ export async function executeAsync (app, command, parms, opts, compilation, opti
logv(options, `touching ${filename}`)
resolve(0)
}
// if (data && data.toString().match(/waiting for changes\.\.\./)) {
// resolve(0)
// }
else {
if (substrings.some(function(v) { return data.indexOf(v) >= 0; })) {
str = str.replace("[INF]", "")
Expand Down

0 comments on commit 935456f

Please sign in to comment.