Fix npm start on windows, fixes #119, #118

This commit is contained in:
Roman Hotsiy 2016-09-28 00:30:33 +03:00
parent f02a23b280
commit 79693e1b27
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
5 changed files with 28 additions and 17 deletions

View File

@ -13,7 +13,6 @@ module.exports = {
resolve: {
extensions: ['.ts', '.js', '.json', '.css'],
alias: {
'./lib/bootstrap': root('lib/bootstrap.dev'),
http: 'stream-http',
https: 'stream-http'
}
@ -55,7 +54,8 @@ module.exports = {
},
module: {
loaders: [{
exprContextCritical: false,
rules: [{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
@ -70,13 +70,13 @@ module.exports = {
],
exclude: [/\.(spec|e2e)\.ts$/]
}, {
test: /lib\/.*\.css$/,
test: /lib[\\\/].*\.css$/,
loaders: ['raw-loader'],
exclude: [/redoc-initial-styles\.css$/]
}, {
test: /\.css$/,
loaders: ['style', 'css?-import'],
exclude: [/lib\/(?!.*redoc-initial-styles).*\.css$/]
exclude: [/lib[\\\/](?!.*redoc-initial-styles).*\.css$/]
}, {
test: /\.html$/,
loader: 'raw-loader'
@ -93,7 +93,8 @@ module.exports = {
new webpack.DefinePlugin({
'IS_PRODUCTION': IS_PRODUCTION,
'LIB_VERSION': VERSION
'LIB_VERSION': VERSION,
'AOT': IS_PRODUCTION
}),
new ForkCheckerPlugin()

View File

@ -48,7 +48,8 @@ module.exports = {
},
module: {
loaders: [{
exprContextCritical: false,
rules: [{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
@ -84,7 +85,8 @@ module.exports = {
new webpack.BannerPlugin(BANNER),
new webpack.DefinePlugin({
'IS_PRODUCTION': true,
'LIB_VERSION': VERSION
'LIB_VERSION': VERSION,
'AOT': true
})
],
}

View File

@ -10,7 +10,6 @@ module.exports = {
resolve: {
extensions: ['.ts', '.js', '.json', '.css'],
alias: {
'./lib/bootstrap': root('lib/bootstrap.dev'),
http: 'stream-http',
https: 'stream-http'
}
@ -37,6 +36,7 @@ module.exports = {
},
module: {
exprContextCritical: false,
rules: [{
enforce: 'pre',
test: /\.js$/,
@ -56,13 +56,13 @@ module.exports = {
],
exclude: [/\.(spec|e2e)\.ts$/]
}, {
test: /lib\/.*\.css$/,
test: /lib[\\\/].*\.css$/,
loaders: ['raw-loader'],
exclude: [/redoc-initial-styles\.css$/]
}, {
test: /\.css$/,
loaders: ['style', 'css?-import'],
exclude: [/lib\/(?!.*redoc-initial-styles).*\.css$/]
exclude: [/lib[\\\/](?!.*redoc-initial-styles).*\.css$/]
}, {
test: /\.html$/,
loader: 'raw-loader'
@ -86,7 +86,8 @@ module.exports = {
plugins: [
new webpack.DefinePlugin({
'IS_PRODUCTION': false,
'LIB_VERSION': VERSION
'LIB_VERSION': VERSION,
'AOT': 'false'
}),
new webpack.LoaderOptionsPlugin({
test: /\.ts$/,
@ -97,11 +98,11 @@ module.exports = {
}),
// ignore changes during tests
new webpack.WatchIgnorePlugin([
/\/ReDoc$/i, // ignore change of ReDoc folder itself
/node_modules\/(?:[^\/]*(?:\/|$))*[^\/]*$/,
/\.tmp\/(?:[^\/]*(?:\/|$))*[^\/]*$/,
/dist\/(?:[^\/]*(?:\/|$))*[^\/]*$/,
/(?:[^\/]*(?:\/|$))*[^\/]*\.css$/ // ignore css files
/[\\\/]ReDoc$/i, // ignore change of ReDoc folder itself
/node_modules[\\\/].*$/,
/\.tmp[\\\/].*$/,
/dist[\\\/].*$/,
/(?:[^\\\/]*(?:[\\\/]|$))*[^\\\/]*\.css$/ // ignore css files
])
],
}

View File

@ -6,7 +6,13 @@ import { Redoc } from './components/index';
import { SpecManager } from './utils/SpecManager';
import { BrowserDomAdapter as DOM } from './utils/browser-adapter';
import { disableDebugTools } from '@angular/platform-browser';
import { bootstrapRedoc } from './bootstrap';
var bootstrapRedoc;
if (AOT) {
bootstrapRedoc = require('./bootstrap').bootstrapRedoc;
} else {
bootstrapRedoc = require('./bootstrap.dev').bootstrapRedoc;
}
if (IS_PRODUCTION) {
disableDebugTools();

View File

@ -14,6 +14,7 @@ declare module "*.css" {
declare var LIB_VERSION: any;
declare var IS_PRODUCTION: any;
declare var AOT: any;
interface ErrorStackTraceLimit {
stackTraceLimit: number;