草庐IT

gulp-webpack

全部标签

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 - 我如何编写一个简单调用函数的 Gulp 任务

我正在努力创建一个Gulp任务,它除了调用自定义函数外什么都不做。不,我没有源文件,不,我没有目标文件。我只想在独立任务中调用自定义函数,这样我就可以根据它执行其他任务。为了我的爱,我已经检查了Google和SO,但找不到示例。我最接近的是这个varthrough=require('through2');gulp.task('my-custom-task',function(){returnthrough.obj(functionwrite(chunk,enc,callback){//hereiswherethecustomfunctioniscalledmyCustomFunctio

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 - 运行 Gulp 会抛出错误 "Cannot find module ' ./lib/_stream_writable.js'”

我正在构建一个关于Root'sSageWordPressTheme的主题.设置并运行必要的命令后。每当我运行Gulp时,它都会抛出以下错误module.js:338throwerr;^Error:Cannotfindmodule'./lib/_stream_writable.js'atFunction.Module._resolveFilename(module.js:336:15)atFunction.Module._load(module.js:278:25)atModule.require(module.js:365:17)atrequire(module.js:384:17)a

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 - Gulp Bundle + Browserify 处理多个文件

所以我有一个简单的gulp任务函数,它当前将我的main.jsx转换为main.js文件:gulp.task("bundle",function(){returnbrowserify({entries:"./app/main.jsx",debug:true}).transform(reactify).bundle().pipe(source("main.js")).pipe(gulp.dest("app/dist"))});我想知道是否可以在这个gulp.task中放入多个包?我理想的结果是能够做到:main.jsx到main.jsotherPage.jsx到otherPage.jso

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