首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我在SPATemplates 2.02中使用Vue和DotNet,使用WebPack等

我在SPATemplates 2.02中使用Vue和DotNet,使用WebPack等
EN

Stack Overflow用户
提问于 2017-11-02 21:04:56
回答 1查看 60关注 0票数 0

当我更改任何代码时,即使我在VSCode或浏览器中重新启动应用程序,更改也不会在浏览器中反映出来。

代码语言:javascript
复制
module.exports = (env) => {
const isDevBuild = !(env && env.prod);

return [{
    stats: { modules: false },
    context: __dirname,
    resolve: { extensions: [ '.js', '.ts' ] },
    entry: { 'main': './ClientApp/boot.ts' },
    module: {
        rules: [
            { test: /\.vue\.html$/, include: /ClientApp/, loader: 'vue-loader', options: { loaders: { js: 'awesome-typescript-loader?silent=true' } } },
            { test: /\.ts$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' },
            { test: /\.css$/, use: isDevBuild ? [ 'style-loader', 'css-loader' ] : ExtractTextPlugin.extract({ use: 'css-loader?minimize' }) },
            { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
        ]
    },
    output: {
        path: path.join(__dirname, bundleOutputDir),
        filename: '[name].js',
        publicPath: 'dist/'
    },
    plugins: [
        new CheckerPlugin(),
        new webpack.DefinePlugin({
            'process.env': {
                NODE_ENV: JSON.stringify(isDevBuild ? 'development' : 'production')
            }
        }),
        new webpack.DllReferencePlugin({
            context: __dirname,
            manifest: require('./wwwroot/dist/vendor-manifest.json')
        })
    ].concat(isDevBuild ? [
        // Plugins that apply in development builds only
        new webpack.SourceMapDevToolPlugin({
            filename: '[file].map', // Remove this line if you prefer inline source maps
            moduleFilenameTemplate: path.relative(bundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
        })
    ] : [
        // Plugins that apply in production builds only
        new webpack.optimize.UglifyJsPlugin(),
        new ExtractTextPlugin('site.css')
    ])
}];

};

EN

回答 1

Stack Overflow用户

发布于 2017-11-02 21:40:33

这是正常的行为。为了应用更改,您应该重新捆绑/重新生成dist文件夹中的bundle.js文件以查看更改,然后刷新浏览器。您可以通过运行以下命令来完成此操作。webpack webpack.config.js

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47076111

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档