小编dph*_*ham的帖子

如何提高webpack的性能?

我最近从browserify切换到webpack,构建时间从4s跃升到16s(2014 MBP).我理解webpack确实比浏览器更多,但我不应该花那么长时间.我的构建过程非常简单.有没有提示或选项来改善我的构建时间?

var webpackOptions = {
  cache : true,
  output: {
    filename: '[name].js',
  },
  module: {
    loaders: [
      { test: /\.js$/, loader: 'jsx-loader' },
      { test: /\.css$/, loader: "style!css" }
    ]
  },
};


gulp.task('buildJs', function(){ 
    multipipe(
      gulp.src(jsSrcPath),
      named(),
      webpack(webpackOptions),
      uglify(),
      gulp.dest(jsDestPath)
    ).on('error', function(error){
      console.log(error)
    });
});
Run Code Online (Sandbox Code Playgroud)

javascript browserify reactjs gulp webpack

24
推荐指数
2
解决办法
2万
查看次数

Thymeleaf:如何使用布局包含页面特定的javascript?

使用thymeleaf有一种方法来装饰我的布局w /我的页面特定的JavaScript和JavaScript包括?

<!--My Layout -->
<!DOCTYPE html>
<html>
<head>

</head>
<body>
<div th:replace="fragments/header :: header">

</div>
<div class="container">
    <div layout:fragment="content">

    </div>
</div>
</body>
</html>

<!--My Page -->
<!DOCTYPE html>
<html layout:decorator="layout">
<head>

</head>
<body>

<div layout:fragment="content">
    hello world
</div>

<script src="pageSpecific1.js"></script>
<script src="pageSpecific2.js"></script>
<script>
 alert("hello world")
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

spring-mvc thymeleaf

14
推荐指数
1
解决办法
3万
查看次数

将信息传递给单击时将返回的canvas元素

有没有办法将一些id或信息传递给canvas元素,这样当你点击它时你可以找回它?

html5 canvas

11
推荐指数
2
解决办法
3万
查看次数

HTML Canvas在Google地图中作为Overlayview

是否有任何谷歌地图的例子,有一个大画布作为overlayview.每当地图缩放或平移时,我都很难定位画布.

html5 google-maps canvas

8
推荐指数
1
解决办法
4159
查看次数

HTML画布作为相对于地图画布固定的Google地图中的Overlayview

我正在尝试创建一个HTML5画布作为OverlayView大小的地图,定位它top:0; left:0;,在其上绘制一些东西,并将其添加到地图.每当地图缩放或平移时,我想从地图中移除旧画布并在其上创建新的画布,将其定位到0,0并将其添加到地图中.但是地图永远不会重新定位到顶部:0; 左:0.有人可以帮忙吗?

    function CustomLayer(map){
this.latlngs = new Array();
this.map_ = map;

this.addMarker = function(position){
this.latlngs.push(position);
}

this.drawCanvas = function(){
this.setMap(this.map_);
//google.maps.event.addListener(this.map_, 'bounds_changed',this.reDraw());
}

}

function defineOverlay() {

CustomLayer.prototype = new google.maps.OverlayView();

CustomLayer.prototype.onAdd = function() {
    console.log("onAdd()");
    if(this.canvas){    
    var panes = this.getPanes();
    panes.overlayLayer.appendChild(this.canvas);
    }
}


CustomLayer.prototype.remove = function() {
    console.log("onRemove()");
    if(this.canvas)
    this.canvas.parentNode.removeChild(this.canvas);
}


CustomLayer.prototype.draw = function() {
    console.log("draw()");
        this.remove();
            this.canvas = document.createElement("canvas");
            this.canvas.setAttribute('width', '800px');
            this.canvas.setAttribute('height', '480px');
            this.canvas.setAttribute('top', '30px');
            this.canvas.setAttribute('left', '30px');
            this.canvas.setAttribute('position', 'absolute');
            this.canvas.setAttribute('border', '1px solid red');
            this.canvas.style.border = …
Run Code Online (Sandbox Code Playgroud)

google-maps google-maps-api-3

8
推荐指数
2
解决办法
3569
查看次数

使用导入的框架构建Mac OS X/Cocoa应用程序以进行分发

所以我构建了一个从Xcode编译并运行良好的应用程序.现在我想将它分发给其他人,以便他们可以使用它.我该怎么做?

我认为它就像归档它一样简单,然后将其作为.pkg或应用程序共享.但每当我打开应用程序时,它都会崩溃,并显示以下消息:

Application Specific Information: 
dyld: launch, loading dependent libraries 
Dyld Error Message: 
  Symbol not found: _OBJC_CLASS_$_CPTBorderedLayer 
  Referenced from: /Users/USER/Desktop/StoreMon.app/Contents/MacOS/ 
StoreMon 
  Expected in: /Library/Frameworks/CorePlot.framework/Versions/A/ 
CorePlot 
 in /Users/USER/Desktop/StoreMon.app/Contents/MacOS/StoreMon 
Run Code Online (Sandbox Code Playgroud)

我正在使用Core Plot框架.

_CPTBorderedLayer类是框架的一部分.如何正确地将此框架打包到我的应用程序中?

macos xcode cocoa core-plot

8
推荐指数
1
解决办法
1502
查看次数