- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 django 存储从 s3 提供我的静态文件,并且正在将它们全部移动到 webpack 包中。这适用于 django-webpack-loader
这并不关心 django 在哪里找到捆绑包。
我的问题是当我开始使用 require.ensure
定义分割点时,捆绑包尝试使用相对路径而不是 s3 存储桶下载 block ,因为 webpack 的代码拆分功能与 django 存储无关。
有没有办法注入(inject)自定义逻辑来按需获取 block ?我并没有将我的 s3 捆绑地址硬编码到配置文件中,但到目前为止我尝试过的任何方法都没有奏效。
这是我的 webpack 配置(用 CoffeeScript 编写)
path = require "path"
webpack = require 'webpack'
BundleTracker = require 'webpack-bundle-tracker'
ExtractTextPlugin = require "extract-text-webpack-plugin"
loaders = require "./loaders.coffee"
module.exports =
context: __dirname
entry: require "./entries.coffee"
output:
path: path.resolve 'app/static/dist/'
filename: '[name].js'
sourceMapFilename: "[name].map.js",
devtool: "source-map"
plugins: [
new BundleTracker filename: './webpack/webpack-stats-prod.json'
new webpack.DefinePlugin
'process.env':
'NODE_ENV': JSON.stringify 'production'
new webpack.optimize.OccurenceOrderPlugin
new ExtractTextPlugin "[name].css"
new webpack.optimize.UglifyJsPlugin
sourceMap: false
compressor:
warnings: false
]
module:
loaders: loaders.production_loaders
resolve: loaders.resolution
最佳答案
原来我只需要在 output
下设置 publicPath 选项.我设置了我的 ansible 脚本以将存储桶地址写入附近的文件。
{bucket} = require "./bucket.json"
module.exports =
context: __dirname
entry: require "./entries.coffee"
output:
path: path.resolve 'app/static/dist/'
filename: '[name].js'
sourceMapFilename: "[name].map.js",
publicPath: bucket + "/static/dist/"
关于django - Webpack:使用 Django 存储从 S3 加载 Codesplit block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40245682/
我计划编写一个 GWT 应用程序,该应用程序将部署到 Web 和移动 Web 以及 native 设备上的应用程序。为此,我将首先将 GWT 编译为 JavaScript,然后使用 GWT-Phone
在this在官方 react 网站上的文章中,我可以清楚地看到使用 await 动态导入模块是允许的,但是当我尝试这样做时(与示例中完全一样)我的代码错误是我得到的: Syntax error: aw
我目前面临着与 GWT 代码拆分相关的相当具有挑战性的问题,希望得到一些帮助。 我目前正在处理一个大型遗留 GWT 应用程序(MVP 之前的日子),我希望根据“portlet”(我们称之为构建页面的各
我正在使用 django 存储从 s3 提供我的静态文件,并且正在将它们全部移动到 webpack 包中。这适用于 django-webpack-loader这并不关心 django 在哪里找到捆绑包
我是一名优秀的程序员,十分优秀!