fix
This commit is contained in:
+2
-2
@@ -4,5 +4,5 @@ static
|
|||||||
kfs
|
kfs
|
||||||
plugins
|
plugins
|
||||||
.rpt2_cache
|
.rpt2_cache
|
||||||
*.js
|
./*.js
|
||||||
*.d.ts
|
./*.d.ts
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
|
||||||
|
const FrontblockLib = {
|
||||||
|
mode: 'production',
|
||||||
|
entry: path.resolve(__dirname, '../../../lib/FrontblockLib.js'),
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, '../../../static'),
|
||||||
|
filename: 'FrontblockLib.js',
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{ test: /\FrontblockLib.ts/, use: 'ts-loader' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
optimization: {
|
||||||
|
minimizer: [new TerserPlugin({
|
||||||
|
cache: true,
|
||||||
|
parallel: true,
|
||||||
|
terserOptions:{
|
||||||
|
mangle: false,
|
||||||
|
keep_classnames: true
|
||||||
|
}
|
||||||
|
})],
|
||||||
|
splitChunks: {
|
||||||
|
cacheGroups: {
|
||||||
|
common: {
|
||||||
|
chunks: 'all',
|
||||||
|
minChunks: 2,
|
||||||
|
maxInitialRequests: 5,
|
||||||
|
minSize: 0,
|
||||||
|
name: 'common'
|
||||||
|
},
|
||||||
|
vendor: {
|
||||||
|
test: /node_modules/,
|
||||||
|
chunks: 'all',
|
||||||
|
name: 'vendor',
|
||||||
|
priority: 10,
|
||||||
|
enforce: true,
|
||||||
|
minChunks: 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = [
|
||||||
|
//Object.assign({}, angularPage),
|
||||||
|
Object.assign({}, FrontblockLib),
|
||||||
|
];
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// Karma configuration file, see link for more information
|
||||||
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||||
|
|
||||||
|
module.exports = function (config) {
|
||||||
|
config.set({
|
||||||
|
basePath: '',
|
||||||
|
frameworks: ['jasmine', '@angular/cli'],
|
||||||
|
plugins: [
|
||||||
|
require('karma-jasmine'),
|
||||||
|
require('karma-chrome-launcher'),
|
||||||
|
require('karma-jasmine-html-reporter'),
|
||||||
|
require('karma-coverage-istanbul-reporter'),
|
||||||
|
require('@angular/cli/plugins/karma')
|
||||||
|
],
|
||||||
|
client:{
|
||||||
|
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||||
|
},
|
||||||
|
coverageIstanbulReporter: {
|
||||||
|
reports: [ 'html', 'lcovonly' ],
|
||||||
|
fixWebpackSourcePaths: true
|
||||||
|
},
|
||||||
|
angularCli: {
|
||||||
|
environment: 'dev'
|
||||||
|
},
|
||||||
|
reporters: ['progress', 'kjhtml'],
|
||||||
|
port: 9876,
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
autoWatch: true,
|
||||||
|
browsers: ['Chrome'],
|
||||||
|
singleRun: false
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// Protractor configuration file, see link for more information
|
||||||
|
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||||
|
|
||||||
|
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||||
|
|
||||||
|
exports.config = {
|
||||||
|
allScriptsTimeout: 11000,
|
||||||
|
specs: [
|
||||||
|
'./e2e/**/*.e2e-spec.ts'
|
||||||
|
],
|
||||||
|
capabilities: {
|
||||||
|
'browserName': 'chrome'
|
||||||
|
},
|
||||||
|
directConnect: true,
|
||||||
|
baseUrl: 'http://localhost:4200/',
|
||||||
|
framework: 'jasmine',
|
||||||
|
jasmineNodeOpts: {
|
||||||
|
showColors: true,
|
||||||
|
defaultTimeoutInterval: 30000,
|
||||||
|
print: function() {}
|
||||||
|
},
|
||||||
|
onPrepare() {
|
||||||
|
require('ts-node').register({
|
||||||
|
project: 'e2e/tsconfig.e2e.json'
|
||||||
|
});
|
||||||
|
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||||
|
}
|
||||||
|
};
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
/* SystemJS module definition */
|
||||||
|
declare var module: NodeModule;
|
||||||
|
interface NodeModule {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import resolve from 'rollup-plugin-node-resolve';
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input: 'src/frontend/widget/main.ts',
|
||||||
|
output: {
|
||||||
|
file: 'FrontendPlugin.js',
|
||||||
|
format: 'system'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
resolve({
|
||||||
|
// pass custom options to the resolve plugin
|
||||||
|
customResolveOptions: {
|
||||||
|
moduleDirectory: 'node_modules'
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
typescript({
|
||||||
|
typescript: require('typescript'),
|
||||||
|
tsconfig: "tsconfig.frontend.json"
|
||||||
|
})
|
||||||
|
],
|
||||||
|
external: [
|
||||||
|
'plugins-core',
|
||||||
|
'@angular/core',
|
||||||
|
'@angular/common'
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user