transpiler

Webpack with babel-loader not recognizing import keyword

▼魔方 西西 提交于 2019-11-28 21:08:51
I have this webpack.config.js : module.exports = { entry: './src/admin/client/index.jsx', output: { filename: './src/admin/client/static/js/app.js' }, loaders: [ { test: /\.jsx?$/, loader: 'babel', exclude: /node_modules/, query: { optional: ['runtime'] } } ], resolve: { extensions: ['', '.js', '.jsx'] } }; ...yet I still get this error: $ webpack -v Hash: 2a9a40224beb025cb433 Version: webpack 1.10.5 Time: 44ms [0] ./src/admin/client/index.jsx 0 bytes [built] [failed] ERROR in ./src/admin/client/index.jsx Module parse failed: /project/src/admin/client/index.jsx Line 1: Unexpected reserved word

Prolog systems in Javascript [closed]

梦想与她 提交于 2019-11-28 06:27:52
Javascript seems to become popular as an implementation language for other programming languages. The article Lightweight compilation of (C)LP to JavaScript. ICLP 2012 drew my attention on this. There are a lot of proof-of-concept prototypes for Prolog systems written in Javascript around on the Web. What are current, actively maintained, preferably ISO conforming Prolog systems written in Javascript? The only Prolog in JavaScript I know is YieldProlog , but I haven't tried it extensively, just the code available in QueryEditor . I was hoping than using the yield construct it was lightweight

Prolog systems in Javascript [closed]

血红的双手。 提交于 2019-11-27 01:22:21
问题 Javascript seems to become popular as an implementation language for other programming languages. The article Lightweight compilation of (C)LP to JavaScript. ICLP 2012 drew my attention on this. There are a lot of proof-of-concept prototypes for Prolog systems written in Javascript around on the Web. What are current, actively maintained, preferably ISO conforming Prolog systems written in Javascript? 回答1: The only Prolog in JavaScript I know is YieldProlog, but I haven't tried it extensively

Extending Error in Javascript with ES6 syntax & Babel

 ̄綄美尐妖づ 提交于 2019-11-26 21:17:10
I am trying to extend Error with ES6 and Babel. It isn't working out. class MyError extends Error { constructor(m) { super(m); } } var error = new Error("ll"); var myerror = new MyError("ll"); console.log(error.message) //shows up correctly console.log(myerror.message) //shows empty string The Error object never get the right message set. Try in Babel REPL . Now I have seen a few solutions on SO ( for example here ), but they all seem very un-ES6-y. How to do it in a nice, ES6 way? (That is working in Babel) Based on Karel Bílek's answer, I'd make a small change to the constructor : class

Typescript- What is target in tsconfig?

混江龙づ霸主 提交于 2019-11-26 20:22:58
问题 I am quite new to Typescript. What does Target in tsconfig.json signify? { "compilerOptions": { "sourceMap": true, "target": "es5", "module": "commonjs", "jsx": "react", "moduleResolution": "classic", "lib": [ "es2015", "dom", "es2017" ] } } 回答1: I am quite new to Typescript. What does Target in tsconfig.json signify? target signifies which target of JavaScript should be emitted from the given TypeScript . Examples: target:es5 ()=>null will become function(){return null} as ES5 doesn't have