* refactor: Reorder tests without lambda Moves inner implementations of Answer and ArgumentMatcher to the top of the test classes. Also changes the lambda expression to a regular "pre java 8" expression in one of the tests. Resolves: BAEL-632 * feat: Create basic Monolithic JHipster project Commit just after creating a JHipster project, before making any modifications. Resolves: BAEL-137 * chore: Change the artifactId and name of the project From baeldung to jhipster-monolithic and JHipster Monolithic Application Relates to: BAEL-137 * feat: Create entities Post and Comment Relates to: BAEL-137 * feat: Fix Gatling configuration in pom.xml Relates to: BAEL-137 * feat: Add files for Continuous Integration Relates to: BAEL-137 * feat: Change pom.xml to conform to Baeldung standards - moved the <properties> element to the bottom of the file - excluded integration tests in the default surefire configuration - added a new profile, called integration, and added the integration tests there - added Java 8 in the <source> and <target> tags, under maven-compiler solves: BAEL-137 * chore: Add jhipster module to parent pom
118 lines
4.6 KiB
JavaScript
118 lines
4.6 KiB
JavaScript
const webpack = require('webpack');
|
|
const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const StringReplacePlugin = require('string-replace-webpack-plugin');
|
|
const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin');
|
|
const path = require('path');
|
|
|
|
module.exports = function (options) {
|
|
const DATAS = {
|
|
VERSION: JSON.stringify(require("../package.json").version),
|
|
DEBUG_INFO_ENABLED: options.env === 'dev'
|
|
};
|
|
return {
|
|
entry: {
|
|
'polyfills': './src/main/webapp/app/polyfills',
|
|
'global': './src/main/webapp/content/scss/global.scss',
|
|
'main': './src/main/webapp/app/app.main'
|
|
},
|
|
resolve: {
|
|
extensions: ['.ts', '.js'],
|
|
modules: ['node_modules']
|
|
},
|
|
module: {
|
|
rules: [
|
|
{ test: /bootstrap\/dist\/js\/umd\//, loader: 'imports-loader?jQuery=jquery' },
|
|
{
|
|
test: /\.ts$/,
|
|
loaders: [
|
|
'angular2-template-loader',
|
|
'awesome-typescript-loader'
|
|
],
|
|
exclude: ['node_modules/generator-jhipster']
|
|
},
|
|
{
|
|
test: /\.html$/,
|
|
loader: 'raw-loader',
|
|
exclude: ['./src/main/webapp/index.html']
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
loaders: ['to-string-loader', 'css-loader', 'sass-loader'],
|
|
exclude: /(vendor\.scss|global\.scss)/
|
|
},
|
|
{
|
|
test: /(vendor\.scss|global\.scss)/,
|
|
loaders: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
loaders: ['to-string-loader', 'css-loader'],
|
|
exclude: /(vendor\.css|global\.css)/
|
|
},
|
|
{
|
|
test: /(vendor\.css|global\.css)/,
|
|
loaders: ['style-loader', 'css-loader']
|
|
},
|
|
{
|
|
test: /\.(jpe?g|png|gif|svg|woff|woff2|ttf|eot)$/i,
|
|
loaders: [
|
|
'file-loader?hash=sha512&digest=hex&name=[hash].[ext]', {
|
|
loader: 'image-webpack-loader',
|
|
query: {
|
|
gifsicle: {
|
|
interlaced: false
|
|
},
|
|
optipng: {
|
|
optimizationLevel: 7
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
test: /app.constants.ts$/,
|
|
loader: StringReplacePlugin.replace({
|
|
replacements: [{
|
|
pattern: /\/\* @toreplace (\w*?) \*\//ig,
|
|
replacement: function (match, p1, offset, string) {
|
|
return `_${p1} = ${DATAS[p1]};`;
|
|
}
|
|
}]
|
|
})
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new CommonsChunkPlugin({
|
|
names: ['manifest', 'polyfills'].reverse()
|
|
}),
|
|
new webpack.DllReferencePlugin({
|
|
context: './',
|
|
manifest: require(path.resolve('./target/www/vendor.json')),
|
|
}),
|
|
new CopyWebpackPlugin([
|
|
{ from: './node_modules/swagger-ui/dist', to: 'swagger-ui/dist' },
|
|
{ from: './src/main/webapp/swagger-ui/', to: 'swagger-ui' },
|
|
{ from: './src/main/webapp/favicon.ico', to: 'favicon.ico' },
|
|
{ from: './src/main/webapp/robots.txt', to: 'robots.txt' },
|
|
{ from: './src/main/webapp/i18n', to: 'i18n' }
|
|
]),
|
|
new webpack.ProvidePlugin({
|
|
$: "jquery",
|
|
jQuery: "jquery"
|
|
}),
|
|
new HtmlWebpackPlugin({
|
|
template: './src/main/webapp/index.html',
|
|
chunksSortMode: 'dependency',
|
|
inject: 'body'
|
|
}),
|
|
new AddAssetHtmlPlugin([
|
|
{ filepath: path.resolve('./target/www/vendor.dll.js'), includeSourcemap: false }
|
|
]),
|
|
new StringReplacePlugin()
|
|
]
|
|
};
|
|
};
|