Giter VIP home page Giter VIP logo

marko-starter-babel's People

Contributors

austinkelleher avatar dylanpiercey avatar mlrawlings avatar philidem avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

retrohacker

marko-starter-babel's Issues

component.js:1 Unexpected token import

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" ]
                    }
                }
            }
        ]
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.