mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
Update webpack configs + add banner (fixes #89)
This commit is contained in:
parent
a01f9f41a4
commit
7f3bdd1603
|
@ -3,12 +3,12 @@ const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin
|
|||
|
||||
const root = require('./helpers').root;
|
||||
const VERSION = JSON.stringify(require('../package.json').version);
|
||||
|
||||
const IS_PRODUCTION = process.env.NODE_ENV === "production";
|
||||
// TODO Refactor common parts of config
|
||||
|
||||
module.exports = {
|
||||
context: root(),
|
||||
devtool: 'cheap-module-source-map',
|
||||
devtool: 'source-map',
|
||||
debug: false,
|
||||
|
||||
resolve: {
|
||||
|
@ -43,22 +43,22 @@ module.exports = {
|
|||
poll: true
|
||||
},
|
||||
port: 9000,
|
||||
hot: true,
|
||||
stats: {
|
||||
modules: false,
|
||||
cached: false,
|
||||
chunk: false
|
||||
}
|
||||
hot: false,
|
||||
stats: 'errors-only'
|
||||
},
|
||||
|
||||
output: {
|
||||
path: root('dist'),
|
||||
filename: '[name].js',
|
||||
sourceMapFilename: '[name].map',
|
||||
sourceMapFilename: '[name].[id].map',
|
||||
chunkFilename: '[id].chunk.js'
|
||||
},
|
||||
|
||||
module: {
|
||||
preLoaders: [{
|
||||
test: /\.js$/,
|
||||
loader: 'source-map'
|
||||
}],
|
||||
loaders: [{
|
||||
test: /\.ts$/,
|
||||
loaders: [
|
||||
|
@ -89,7 +89,7 @@ module.exports = {
|
|||
}),
|
||||
|
||||
new webpack.DefinePlugin({
|
||||
'IS_PRODUCTION': false,
|
||||
'IS_PRODUCTION': IS_PRODUCTION,
|
||||
'LIB_VERSION': VERSION
|
||||
}),
|
||||
|
||||
|
|
|
@ -4,6 +4,11 @@ const VERSION = JSON.stringify(require('../package.json').version);
|
|||
|
||||
const root = require('./helpers').root;
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const BANNER =
|
||||
`ReDoc - OpenAPI/Swagger-generated API Reference Documentation
|
||||
-------------------------------------------------------------
|
||||
Version: ${VERSION}
|
||||
Repo: https://github.com/Rebilly/ReDoc`;
|
||||
|
||||
module.exports = {
|
||||
context: root(),
|
||||
|
@ -72,7 +77,7 @@ module.exports = {
|
|||
},
|
||||
sourceMap: true
|
||||
}),
|
||||
|
||||
new webpack.BannerPlugin(BANNER),
|
||||
new webpack.DefinePlugin({
|
||||
'IS_PRODUCTION': true,
|
||||
'LIB_VERSION': VERSION
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
"start": "webpack-dev-server --config build/webpack.dev.js --content-base demo",
|
||||
"e2e-server": "http-server -p 3000 tests/e2e",
|
||||
"e2e-copy": "cp dist/redoc.min.js tests/e2e/",
|
||||
"webdriver": "webdriver-manager update"
|
||||
"webdriver": "webdriver-manager update",
|
||||
"serve:prod": "NODE_ENV=production npm start"
|
||||
},
|
||||
"keywords": [
|
||||
"OpenAPI",
|
||||
|
|
Loading…
Reference in New Issue
Block a user