Comparing version 0.3.1 to 0.3.2
@@ -28,6 +28,6 @@ "use strict"; | ||
else if (testStr.indexOf('tsx') >= 0) { | ||
return ['tsx', 'ts']; | ||
return ['tsx', 'ts', 'jsx', 'js']; | ||
} | ||
else if (testStr.indexOf('ts') >= 0) { | ||
return ['ts']; | ||
return ['ts', 'js']; | ||
} | ||
@@ -34,0 +34,0 @@ }, |
@@ -13,4 +13,4 @@ "use strict"; | ||
if (stack.hasAll(['ts', 'webpack'])) { | ||
var jsRuleFinder = new JSRuleFinder_1.default(builder); | ||
var jsRule = jsRuleFinder.rule; | ||
var jsRuleFinder_1 = new JSRuleFinder_1.default(builder); | ||
var jsRule = jsRuleFinder_1.rule; | ||
var CheckerPlugin = requireModule_1.default('awesome-typescript-loader').CheckerPlugin; | ||
@@ -22,2 +22,10 @@ jsRule.test = /\.ts$/; | ||
builder.config = spin.merge(builder.config, { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.html$/, | ||
loader: 'html-loader' | ||
}, | ||
] | ||
}, | ||
plugins: [ | ||
@@ -27,2 +35,6 @@ new CheckerPlugin() | ||
}); | ||
builder.config.resolve.extensions = | ||
['.'] | ||
.map(function (prefix) { return jsRuleFinder_1.extensions.map(function (ext) { return prefix + ext; }); }) | ||
.reduce(function (acc, val) { return acc.concat(val); }); | ||
if (!stack.hasAny('dll')) { | ||
@@ -29,0 +41,0 @@ for (var key in builder.config.entry) { |
@@ -30,4 +30,14 @@ "use strict"; | ||
else { | ||
plugins.push(new webpack.optimize.UglifyJsPlugin({ minimize: true })); | ||
plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true })); | ||
var uglifyOpts = { minimize: true }; | ||
if (stack.hasAny('angular')) { | ||
uglifyOpts.mangle = { keep_fnames: true }; | ||
} | ||
plugins.push(new webpack.optimize.UglifyJsPlugin(uglifyOpts)); | ||
var loaderOpts = { minimize: true }; | ||
if (stack.hasAny('angular')) { | ||
loaderOpts.htmlLoader = { | ||
minimize: false | ||
}; | ||
} | ||
plugins.push(new webpack.LoaderOptionsPlugin(loaderOpts)); | ||
plugins.push(new webpack.optimize.ModuleConcatenationPlugin()); | ||
@@ -142,2 +152,3 @@ } | ||
noInfo: true, | ||
historyApiFallback: true, | ||
stats: { colors: true, chunkModules: false }, | ||
@@ -144,0 +155,0 @@ }; |
{ | ||
"name": "spinjs", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "clean": "rm -rf ./lib", |
@@ -27,7 +27,7 @@ import { Builder } from "../../Builder"; | ||
} else if (testStr.indexOf('tsx') >= 0) { | ||
return ['tsx', 'ts']; | ||
return ['tsx', 'ts', 'jsx', 'js']; | ||
} else if (testStr.indexOf('ts') >= 0) { | ||
return ['ts']; | ||
return ['ts', 'js']; | ||
} | ||
} | ||
} |
@@ -24,2 +24,10 @@ import * as path from "path"; | ||
builder.config = spin.merge(builder.config, { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.html$/, | ||
loader: 'html-loader' | ||
}, | ||
] | ||
}, | ||
plugins: [ | ||
@@ -30,2 +38,7 @@ new CheckerPlugin() | ||
builder.config.resolve.extensions = | ||
['.'] | ||
.map(prefix => jsRuleFinder.extensions.map(ext => prefix + ext)) | ||
.reduce((acc, val) => acc.concat(val)); | ||
if (!stack.hasAny('dll')) { | ||
@@ -32,0 +45,0 @@ for (let key in builder.config.entry) { |
@@ -28,4 +28,15 @@ import * as path from 'path'; | ||
} else { | ||
plugins.push(new webpack.optimize.UglifyJsPlugin({ minimize: true })); | ||
plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true })); | ||
const uglifyOpts: any = { minimize: true }; | ||
if (stack.hasAny('angular')) { | ||
// https://github.com/angular/angular/issues/10618 | ||
uglifyOpts.mangle = { keep_fnames: true }; | ||
} | ||
plugins.push(new webpack.optimize.UglifyJsPlugin(uglifyOpts)); | ||
const loaderOpts: any = { minimize: true }; | ||
if (stack.hasAny('angular')) { | ||
loaderOpts.htmlLoader = { | ||
minimize: false // workaround for ng2 | ||
}; | ||
} | ||
plugins.push(new webpack.LoaderOptionsPlugin(loaderOpts)); | ||
plugins.push(new webpack.optimize.ModuleConcatenationPlugin()); | ||
@@ -149,2 +160,3 @@ } | ||
noInfo: true, | ||
historyApiFallback: true, | ||
stats: { colors: true, chunkModules: false }, | ||
@@ -151,0 +163,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
275172
4404