jjzjj

webpack-plugin

全部标签

javascript - Webpack 和 AWS Lambda 问题 - 模块上缺少处理程序

我使用ES6、babel和Webpack2来捆绑AWSLambda。然后我使用本地AWSSAM运行/测试它。当我点击api时出现以下错误-Handler'handler'missingonmodule'dist/main'这是我的webpack.config.js-constpath=require('path');module.exports={entry:'./index.js',output:{path:path.resolve(__dirname,'dist'),filename:'main.js',libraryTarget:'commonjs'},module:{rules

javascript - 将 socket.io-client 与 webpack 一起使用时未定义全局

当我在我的React网络应用程序中添加socket.io-client插件时出现以下错误。UncaughtReferenceError:globalisnotdefinedatObject../node_modules/socket.io-parser/is-buffer.js(is-buffer.js:4)atwebpack_require(bootstrap:22)atObject../node_modules/socket.io-parser/binary.js(binary.js:8)atwebpack_require(bootstrap:22)atObject../node_

javascript - 将 fullcalendar 与 webpack 结合使用

我使用npm、webpack和FullCalendar,但在使用fullcalendar时,浏览器控制台出现以下错误:main.js:37556UncaughtTypeError:(0,_jquery2.default)(...).fullCalendarisnotafunction我该如何解决这个问题?我使用FullCalendar3.0.0-beta和jquery3.1.0。我的代码如下。index.js:import$from'jquery'importjQueryUIfrom'jquery-ui'importmomentfrom'moment'importfullCalenda

javascript - 等到 Webpack 开发服务器准备就绪

要求我需要运行webpack-dev-server并等待服务器准备好提供页面。解决方案//Startawebpack-dev-servernewWebpackDevServer(webpack(myConfig),{publicPath:myConfig.output.publicPath,hot:true,historyApiFallback:true,//Itsuppresserrorshowninconsole,soithastobesettofalse.quiet:false,//Itsuppresseverythingexcepterror,soithastobesettof

javascript - 样式加载器不适用于 Webpack2

我已经简化了我的webpack2配置。但这仍然不起作用(没有错误和警告)。webpack.config.jsconstpath=require('path');constHtmlWebpackPlugin=require('html-webpack-plugin');constsvgDirs=[require.resolve('antd-mobile').replace(/warn\.js$/,''),path.resolve(__dirname,'src/assets/svg'),];module.exports={entry:path.join(__dirname,'src/ind

javascript - 如何在 Webpack 和 Sass 中使用 spriting?

我正在将我的构建系统从带有自定义任务的Grunt转移到Webpack。至于JavaScript模块,它工作得很好,但我不太确定如何处理我的Sass样式表。我在我的AMD模块中依赖于Sass文件,Webpack可以从中读取并生成bundle.css。但理想情况下,我希望我的构建管道使用spritesmith生成sprite,然后将图像复制到构建目录并使用Sassmixins生成正确的CSS规则。我在SO和Google上对此进行了很多研究,但还没有发现任何人在做类似的情况。我应该只使用webpack吗?或者我是否应该有单独的Grunt任务来观看图像、生成Sprite然后在其上运行Webpa

javascript - Webpack 开发服务器热模式不起作用

这是我的配置:devServer:{contentBase:'/web/dist/',hot:true,stats:{colors:true},inline:true}这是我正在运行的gulp任务:gulp.task('build',['clean','styles','bower','media','data','homepage'],function(done){es6promise.polyfill();console.log('STARTINGDEVSERVER...');server=newWebpackDevServer(webpack(webpackDevConfig),

javascript - webpack css loader 不工作 : no output css file

我正在从事开源元素,现在我需要为前端设置webpack。我在下面尝试了webpack配置,JS工作正常,但css不行,没有css输出文件。我不知道为什么会这样,请帮助我。下面是我的webpack配置js文件:constpath=require("path");constwebpack=require('webpack');constExtractTextPlugin=require("extract-text-webpack-plugin");constnode_dir=__dirname+'/node_modules';constsassLoaders=['css-loader','

javascript - webpack.config.babel.js中使用 'import'报错

(function(exports,require,module,__filename,__dirname){importpathfrom'path'^^^^^^SyntaxError:Unexpectedtokenimport当我使用webpack-dev-server--hot时出现此错误。出现这种情况好像是因为它无法读取import或者webpack不支持import。我尝试使用babel-register但它不起作用。有什么办法可以解决这个问题吗?请引用下面的代码。webpack.config.babel.jsimportpathfrom'path'importwebpackf

javascript - webpack 2 不能在 IE11 上运行?

我有一个非常基本的javascript项目,它使用webpack(^2.6.0)作为模块bundler。有一个作为vendor模块的依赖项,我有一个入口点。我的配置如下:constpath=require('path');constwebpack=require('webpack');module.exports={entry:{bundle:'./modules/main.js',vendor:['react']},output:{path:path.join(__dirname,'build'),filename:'[name].js',chunkFilename:'[id].js