1
내 웹팩 설정이index.html을이 vendor.js을 포함하고는 동일한 DIST 폴더에 어디에 "/"
config.output = isTest ? {} : {
path: __dirname + '/dist',
publicPath: baseUrl,
filename: isProd ? '[name].[hash].js' : '[name].bundle.js',
chunkFilename: isProd ? '[name].[hash].js' : '[name].bundle.js'
};
if (!isTest) {
config.plugins.unshift(
new HtmlWebpackPlugin({
template: './app/index.ejs',
inject: 'body',
baseUrl: '/'
}),
new ExtractTextPlugin('[name].[hash].css', {disable: !isProd})
);
config.plugins.push(
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js')
);
}
를 다음과 같습니다과 app.bundle.js하지만 난 실행할 때 웹팩 셋 모두 동일한 폴더에 있지만 내가 실행할 때/그러므로
<script type="text/javascript" src="/vendors.js"></script><script type="text/javascript" src="/app.bundle.js"></script></body>
A의 vendor.js /app.bundle.js과 함께 DIST 폴더 index.html 파일을 생성
webpack-dev-server --history-api-fallback --inline --progress --host 0.0.0.0
제대로 페이지를 렌더링하고 다음과 같이 JQuery와 모듈을 찾을 수 없다는 오류가 발생하지 않습니다
Uncaught ReferenceError: jQuery is not defined(anonymous function) @ transition.js:59__webpack_require__ @ bootstrap 26cc2c2…:50(anonymous function) @ no-op.js?59ab:1__webpack_require__ @ bootstrap 26cc2c2…:50(anonymous function) @ no-op.js:2__webpack_require__ @ bootstrap 26cc2c2…:50(anonymous function) @ loader.js:1__webpack_require__ @ bootstrap 26cc2c2…:50(anonymous function) @ bootstrap 26cc2c2…:96__webpack_require__ @ bootstrap 26cc2c2…:50(anonymous function) @ bootstrap 26cc2c2…:96(anonymous function) @ bootstrap 26cc2c2…:96 angular.js:68