我已经实现了webpack,以便从我的角度应用程序生成一个文件。 webpack.js
现在问题是每当我更改TypeScript文件时,我都必须重新运行webpack才能看到效果。
这大大减缓了发展。
如何配置立即更改的webpack或打字稿?
webpack.config.js:
iMac-2:lib mac$ lipo -arch libpj-arm64-apple-darwin_ios.a -arch libpj-armv7-apple-darwin_ios.a -arch libpj-armv7s-apple-darwin_ios.a -arch libpj-x86_64-apple-darwin16.0.0.a -create -output libpjlib.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: unknown architecture specification flag: libpj-arm64-apple-darwin_ios.a in specifying input file -arch libpj-arm64-apple-darwin_ios.a -arch
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: known architecture flags are: any little big ppc64 x86_64 x86_64h arm64 ppc970-64 ppc i386 m68k hppa sparc m88k i860 veo arm ppc601 ppc603 ppc603e ppc603ev ppc604 ppc604e ppc750 ppc7400 ppc7450 ppc970 i486 i486SX pentium i586 pentpro i686 pentIIm3 pentIIm5 pentium4 m68030 m68040 hppa7100LC veo1 veo2 veo3 veo4 armv4t armv5 xscale armv6 armv6m armv7 armv7f armv7s armv7k armv7m armv7em arm64v8
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo [input_file] ... [-arch <arch_type> input_file] ... [-info] [-detailed_info] [-output output_file] [-create] [-arch_blank <arch_type>] [-thin <arch_type>] [-remove <arch_type>] ... [-extract <arch_type>] ... [-extract_family <arch_type>] ... [-verify_arch <arch_type> ...] [-replace <arch_type> <file_name>] ...
tsconfig.json
const webpack = require('webpack');
module.exports = {
entry: {
app: './app/main.js',
vendor: './app/vendor.js'
},
output: {
//path: './bin',
filename: 'webpack/webpack-[name].js'
},
resolve: {
extensions: ['', '.js', '.ts']
},
devtool: 'source-map',
module: {
loaders: [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.css$/, loaders: ['style', 'css'] },
{ test: /\.json/, loaders: ['json-loader'] },
{ test: /\.html/, loaders: ['raw-loader'] },
{ test: /\.(jpg|png|gif)$/, loaders: ['file-loader'] }
]}
// Add minification
, plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
output: {
comments: false
}
})
]
};
答案 0 :(得分:0)
如何配置立即进行更改的webpack或打字稿
实际配置如何运行webpack 。如果您使用webpack --watch
,只要您做出更改,它就会自动更新软件包,但是您仍然需要刷新浏览器页面。如果您使用webpack-dev-server
作为webpack-dev-server --hot --inline
,甚至可以立即重新加载您的浏览器页面。