我做了一些测试来处理位于webpack文件夹之外的文件.我有三个简单的文件:
/*entry.js*/
import style from "./style.css";
import string from "./content.js";
console.log(string);
Run Code Online (Sandbox Code Playgroud)
/*style.css*/
body {
background: beige;
}
Run Code Online (Sandbox Code Playgroud)
/*content.js*/
export default string = "It works from content.js.";
Run Code Online (Sandbox Code Playgroud)
我使用ES6语法,所以我有.babelrc这样的:
{
"presets": [
"react",
"es2015"
]
}
Run Code Online (Sandbox Code Playgroud)
这是我的webpack.config.js:var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: './../outsidefolder/client/wptest/entry.js',
//entry: './entry.js',
debug:true,
devtool:'source-map',
resolve: {
extensions: ['', '.js', '.jsx', '.css']
},
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.js?$/,
loaders: ['babel']
},{ …Run Code Online (Sandbox Code Playgroud) 我正在使用Babel Jest转换我的代码以进行测试。我不知道如何使用相对于项目根目录的路径。
例如,如果我在测试文件中导入以下模块:/imports/ui/myModuleJest抛出错误
Cannot find module
'/Users/me/dev/myProject/Users/me/dev/myProject/imports/ui/myModule' from 'test.jsx'`
Run Code Online (Sandbox Code Playgroud)
但是,如果我导入一个具有相对路径的模块,例如:../../ui/myModule它起作用。
我的.babelrc:
{
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"babel-root-slash-import"
],
"presets": [
"es2015",
"react",
"stage-0"
],
"env": {
"test": {
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"babel-root-slash-import"
],
"presets": [
"es2015",
"react",
"stage-0"
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的笑话配置是:
"jest": {
"roots": ["<rootDir>/imports/tests/jest"]
},
Run Code Online (Sandbox Code Playgroud) 我试图在SSH上停止kibana,kill但它立即重新生成
dagatsoin@dagatsoin.io [~/logstash]# ps aux | grep kibana
533 28778 0.0 0.0 9292 876 pts/2 S+ 00:16 0:00 grep kibana
dagatsoin@dagatsoin.io [~/logstash]# kill -kill 28778
-bash: kill: (28778) - Aucun processus de ce type
dagatsoin@dagatsoin.io [~/logstash]# ps aux | grep kibana
533 28780 0.0 0.0 9292 876 pts/2 S+ 00:16 0:00 grep kibana
dagatsoin@dagatsoin.io [~/logstash]#
Run Code Online (Sandbox Code Playgroud)
你怎么杀了这个过程?
使用 Typescript 时,是否有在 Meteor 1.3 中使用模式验证的包。Meteor 指南(aldeed:simple-schema)中的推荐包似乎没有定义文件。
那么改用什么,或者 Typescript 有一个内置的方法来做到这一点?
我通过 SSH 在我的服务器上启动了 Logstash,但与 Elasticsearch 的连接错误。当我尝试 CTRL+C Logstash 并没有停止,他现在仍在运行。我怎样才能强制它停止?
我的服务器运行CentOS5
Got error to send bulk of actions to elasticsearch server at localhost : blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];[SERVICE_UNAVAILABLE/2/no master]; {:level=>:error}
Failed to flush outgoing items {:outgoing_count=>552, :exception=>org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];[SERVICE_UNAVAILABLE/2/no master];, :backtrace=>["org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedException(org/elasticsearch/cluster/block/ClusterBlocks.java:151)", "org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedRaiseException(org/elasticsearch/cluster/block/ClusterBlocks.java:141)", "org.elasticsearch.action.bulk.TransportBulkAction.executeBulk(org/elasticsearch/action/bulk/TransportBulkAction.java:210)", "org.elasticsearch.action.bulk.TransportBulkAction.access$000(org/elasticsearch/action/bulk/TransportBulkAction.java:73)", "org.elasticsearch.action.bulk.TransportBulkAction$1.onFailure(org/elasticsearch/action/bulk/TransportBulkAction.java:148)", "org.elasticsearch.action.support.TransportAction$ThreadedActionListener$2.run(org/elasticsearch/action/support/TransportAction.java:137)", "java.util.concurrent.ThreadPoolExecutor.runWorker(java/util/concurrent/ThreadPoolExecutor.java:1145)", "java.util.concurrent.ThreadPoolExecutor$Worker.run(java/util/concurrent/ThreadPoolExecutor.java:615)", "java.lang.Thread.run(java/lang/Thread.java:745)"], :level=>:warn}
SIGTERM received. Shutting down the pipeline. {:level=>:warn}
^CSIGINT received. Shutting down the pipeline. {:level=>:warn}
^CSIGINT received. Shutting down the pipeline. {:level=>:warn}
^CSIGINT received. …Run Code Online (Sandbox Code Playgroud) 我正在启动一个分析项目,该项目将处理数百万个地理定位数据.数据可能是这样的:
id{
userId,
long,
lat,
time,
appId
}
我的主要业务:
我想使用Meteor.js并且需要近乎实时的性能(最多~0.5s到3s).
也许这很重要:我的结果需要3-15米之间的精度.
所以我看了看:
Redis:接缝简单易用,有一个Redis Geo插件.另外还有一个流星驱动程序.
PostGIS: M +条目的实时表现?没有流星的司机.
PostGre:有一个流星驱动程序.
Hbase:为大桌子构建接缝.没有流星的司机.
你会用哪一个?(任何其他建议将不胜感激.)
我开始将我的商店连接到mobx.我想知道使用observer(['store'],...)或使用之间的区别inject('store')(observer(...))
我认为注入的主要区别不是反应性.那么注入观察者的意图究竟是什么呢?
我正在尝试使用React安装/取消Pixi舞台(我现在还不想使用react-pixi)
重新安装组件时出现错误:
Uncaught Error: Resource with name "cupCake.png" already exists
i.add.i.enqueueapp.js
componentDidMountmodules.js
_assign.notifyAllmodules.js
ON_DOM_READY_QUEUEING.closemodules.js
Mixin.closeAllmodules.js
Mixin.performmodules.js
Mixin.performmodules.js
_assign.performmodules.js
flushBatchedUpdatesmodules.js
Mixin.closeAllmodules.js
Mixin.performmodules.js
ReactDefaultBatchingStrategy.batchedUpdatesmodules.js
batchedUpdatesmodules.js
ReactEventListener.dispatchEvent
Run Code Online (Sandbox Code Playgroud)
我尝试使用:PIXI.TextureCache['cupCake.png'].destroy(true);但是错误仍然存在。
这是我的组件:
class MapOverlay extends React.Component{
constructor(props) {
super(props);
}
componentDidMount() {
this.renderer = PIXI.autoDetectRenderer(256, 256, {transparent: true});
this.refs.gameCanvas.appendChild(this.renderer.view);
// create the root of the scene graph
this.stage = new PIXI.Container();
this.stage.width = 1366;
this.stage.height = 768;
PIXI.loader
.add("cupCake.png")
.load(()=> {
//Create the `cat` sprite from the texture
var cat = new PIXI.Sprite(
PIXI.loader.resources["cupCake.png"].texture …Run Code Online (Sandbox Code Playgroud) javascript ×3
reactjs ×2
babel-jest ×1
babeljs ×1
centos ×1
centos5 ×1
es6-modules ×1
geolocation ×1
hbase ×1
jestjs ×1
kibana ×1
linux ×1
logstash ×1
meteor ×1
mobx ×1
mongodb ×1
node.js ×1
pixi.js ×1
postgis ×1
postgresql ×1
redis ×1
typescript ×1
webpack ×1