marko-js-archive / marko-starter-babel Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi Nixx here at the MotherShip in PDX, Yes I live for pain running the latest of everything :-)
I have been using Marko-Starter for a little while now, good stuff. Now I am trying to ES2016 all my code. I added Marko-Starter-Babel and the suggested config.
I have a standalone Marko Component I'm building. When I run marko-starter server
I get an error on the first line of the component. I had everything working before I started down the ES2016 updates in my project, so no ugly errors there. I am not sure if I am missing something or what. But it seems Babel is not transforming the component as expected. I've tried several different ways of Babelising the code without success.
Any thoughts, Ideas are very much appreciated.
[marko-starter plugins] Installed plugin: lasso
/../component.js:1
(function (exports, require, module, __filename, __dirname) { import update from 'immutability-helper';
SyntaxError: Unexpected token import
my dependencies included in package.json:
...
"lasso-babel-transform": "^1.0.1",
"lasso-less": "^2.4.3",
"lasso-marko": "^2.3.0",
"lasso-sass": "^2.0.0",
"lasso-tools": "^2.0.9",
"marko": "4.4.6",
"marko-devtools": "git://github.com/marko-js/marko-devtools#v1.0.6",
"marko-starter": "git://github.com/marko-js/marko-starter#v1.1.8",
"marko-starter-babel": "git://github.com/marko-js/marko-starter#v1.0.2",
...
project.js
const markoStarter = require('marko-starter');
markoStarter.plugins(['marko-starter-babel']);
const lassoConf = require('./config/lasso.json');
const paypalPaymentsApi = require('./lib/paypalExpressCheckoutService');
const indexTemplate = require('marko').load(require.resolve('./test/test-page/index.marko'));
module.exports = require('marko-starter').projectConfig({
routePathPrefix: '/',
lassoConfig: lassoConf,
plugins: ['marko-starter-babel'],
routes: [
{
route: {
path: '/',
metadata: {},
params: {},
handler: (req, res) => {
indexTemplate.render({
componentName: 'My Component'
},
function(err, html) {
console.log(`Template output: ${html}`);
if(err){
console.log(`ERROR: ${err}`);
}
});
}
}
}, {
route: {
path: '/foo',
metadata: {},
params: {},
handler: (req, res) => res
}
}
]
});
lasso.json
{
"flags": ["OTD"],
"bundlingEnabled": true,
"minify": false,
"cacheProfile": "development",
"resolveCssUrls": true,
"fingerprintsEnabled": true,
"includeSlotNames": true,
"noConflict": "OTD",
"outputDir": "./static",
"bundles": [
{
"name": "jquery",
"dependencies": [
"require: jquery"
]
}
],
"plugins": [
"lasso-marko",
{
"plugin": "lasso-sass",
"config": {
"extensions": ["scss", "sass", "css"]
}
},
{
"plugin": "lasso-less",
"config": {
"extensions": [
"less", "css"
],
"lessConfig": {
"strictMath": true,
"strictUnits": true
}
}
}
],
"require": {
"transforms": [
{
"transform": "lasso-babel-transform",
"config": {
"extensions": [".js"],
"babelOptions": {
"presets": [ "latest" ]
}
}
}
]
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.