答案 0 :(得分:0)
/ *请求* /
Request URL:localhost:8080
Request Headers
Provisional headers are shown
Referer:http://localhost:8080/
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
/ * webpack.config.main * /
var path = require('path');
module.exports = {
context: path.resolve(__dirname, '..', 'src'),
entry: {
vendor: [
'angular',
'angular-ui-bootstrap',
'angular-ui-router',
'angular-animate',
'angular-touch',
'angular-cookies',
'angular-sanitize',
'angular-block-ui',
'angular-messages',
'angular-translate',
'angular-dynamic-locale',
'angular-translate-loader-static-files',
'angular-translate-storage-cookie',
'angular-translate-storage-local'
]
},
output: {
filename: "bundle.js"
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js']
},
module: {
loaders: [
{ test: /\.ts$/, loader: "ts-loader" },
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.scss$/, loaders: ["style", "css", "sass"] },
{
test: /\.(png|jpg|jpeg|svg|gif|ttf|woff|woff2|eot)(\?v=\d+\.\d+\.\d+)?$/,
loader: "file-loader?[hash:6].[ext]"
},
{ test: /\.json$/, loader: "json-loader" }
]
},
devServer: {
proxy: {
'/MerchantApiWeb/**': {
target: 'http://example.com:8080',
secure: false
}
}
}
};
/ * webpack.config.dev.fdp * /
var webpack = require('webpack');
var path = require('path');
var merge = require('merge');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var GenerateJsonPlugin = require('generate-json-webpack-plugin');
var appName = 'fdp';
module.exports = merge.recursive(true, require('./webpack.config.main'), {
name: 'dev.' + appName,
devtool: 'inline-source-map',
entry: {
app: [path.resolve(__dirname, '..', 'src', 'app', appName, appName + '.boot.ts')]
},
output: {
path: path.resolve(__dirname, '../build', 'dev', appName)
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js'),
new HtmlWebpackPlugin({
title: 'FDP',
template: path.resolve(__dirname, 'templates', 'fdp.index.ejs'),
baseUrl: '/'
}),
new CopyWebpackPlugin([
{ from: 'app/commons/**/*.html' },
{ from: 'app/fdp/**/*.html' },
{ from: 'app/commons/**/*.json' },
{ from: 'app/fdp/**/*.json' },
{ from: 'app/**/*.js' },
{ from: 'app/fdp/dashboard/directives/banner/assets/**/*' },
{ from: '../node_modules/chart.js/dist/Chart.bundle.min.js', to: 'chart.js' },
{ from: '../node_modules/mobile-detect/mobile-detect.js', to: 'mobile-detect.js' }
]),
new GenerateJsonPlugin('version.json', {
buildDate: (new Date()).toUTCString(),
name: appName,
version: 'Alpha'
})
]
});
答案 1 :(得分:0)
devtool: 'inline-source-map'
它有效。
谢谢大家。