这么简单的问题但是htaccess和我从来没有相处过。
这是.htaccess:
# Disable the directory processing, Apache 2.4
DirectoryIndex disabled xxx
RewriteEngine On
# Serve existing files
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
# For / serve index.html if it exists
RewriteCond %{REQUEST_URI} ^/$
RewriteCond index.html -f
RewriteRule .? index.html [L]
# Otherwise use front controller
RewriteRule .? app.php [L]
Run Code Online (Sandbox Code Playgroud)
如果我注释掉 RewriteCond index.html -f 行,只要 index.html 确实存在,它就会起作用。但我也想检查 index.php,所以我需要检查文件是否存在。如果没有别的,我想了解为什么张贴的行不起作用。
我正在关注http://alexomara.com/blog/webpack-and-jquery-include-only-the-parts-you-need使用webpack捆绑部分jQuery.
// webpack.config.js
module.exports = {
entry: './entry',
output: {
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /jquery\/src\/selector\.js$/,
loader: 'amd-define-factory-patcher-loader'
}
]
}
};
Run Code Online (Sandbox Code Playgroud)
事实证明,node_modules/jquery/src/selector.js
由于AMD问题需要它自己的加载器.但是没有应用装载机.我在windows下运行,也许regexp需要调整?我试过不同的表情,但没有运气.
有关如何调试的任何建议?webpack新手.
正如所建议的,我补充说:
profile: true,
stats: {
reasons: true,
chunkModules: true,
chunkOrigins: true,
modules: true,
cached: true,
cachedAssets: true,
source: true,
errorDetails: true,
publicPath: true,
excludeModules: [
/e\.js/
]
Run Code Online (Sandbox Code Playgroud)
运行webpack --display-modules
收益率
Hash: 4a092c0d4d9e158a9bd7
Version: webpack 1.10.1
Time: 970ms
Asset Size Chunks Chunk Names
bundle.js 876 kB 0 [emitted] …
Run Code Online (Sandbox Code Playgroud)