GithubHelp home page GithubHelp logo

gulp-inline-ng2-styles's People

Contributors

ludohenin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

gulp-inline-ng2-styles's Issues

Plugin not finding relative components.

The following is the header of my NG2 class

import {Component} from '@angular/core';
import { ApplicationConstants } from '../../constants/ApplicationConstants';
import { Hero } from './hero'
import { HeroDetailComponent } from './detail/hero-detail.component';
import { HeroService } from './hero.service';
import { OnInit } from '@angular/core';
import {MdIconRegistry} from "@angular2-material/icon/icon-registry";
import {MD_CARD_DIRECTIVES} from "@angular2-material/card/card";
import {MD_BUTTON_DIRECTIVES} from "@angular2-material/button/button";
import {MD_ICON_DIRECTIVES} from "@angular2-material/icon/icon";
import {MD_LIST_DIRECTIVES} from "@angular2-material/list/list";
import {MD_INPUT_DIRECTIVES} from "@angular2-material/input/input";
import {MdToolbar} from "@angular2-material/toolbar/toolbar";
@Component({
    selector: 'hero',
    templateUrl: 'hero.component.html',
    styleUrls: [ 'components/hero/hero.component.css' ],
    directives: [HeroDetailComponent, MD_CARD_DIRECTIVES, MD_BUTTON_DIRECTIVES, MD_LIST_DIRECTIVES, MD_ICON_DIRECTIVES, MdToolbar, MD_INPUT_DIRECTIVES],
    providers: [HeroService],
    viewProviders: [MdIconRegistry]
})

then the plugin is configured....

gulp.task('js:build', function () {
  var tsProject = ts.createProject('tsconfig.json');
  return tsProject.src() // also can use *.js files
    .pipe(embedTemplates({sourceType: 'ts'}))
    .pipe(inlineNg2Styles({base: '/src/ng2'}))
    .pipe(sourcemaps.init())
    .pipe(ts(tsProject))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest("public/ng2"));
});

When I try to run the inline styling I get...

ReferenceError: HeroDetailComponent is not defined
at eval (eval at replace (C:\Users\jgleason\dev\code\ng2-demo-app\node_modules\gulp-inline-ng2-styles\index.js:86:36), :25:18)
at replace (C:\Users\jgleason\dev\code\ng2-demo-app\node_modules\gulp-inline-ng2-styles\index.js:86:14)
at C:\Users\jgleason\dev\code\ng2-demo-app\node_modules\gulp-inline-ng2-styles\index.js:74:44

The project I am trying to integrate with is https://github.com/jrgleason/ng2-demo-app

Buggy in a situation

This is buggy

@View({
  templateUrl: './app.html',
  styleUrls: ['./app.css'],
  directives: [ROUTER_DIRECTIVES]
})

where this works

@View({
  templateUrl: './app.html?v=<%= VERSION %>',
  styleUrls: [
    './app.css'
  ],
  directives: [ROUTER_DIRECTIVES]
})

SyntaxError: Unexpected token export

I'm trying to use this package to inline my scss files into angular2 components.

My gulpfile:

gulp.task('js:build', function () {
    gulp.src('src/**/*.ts')
        .pipe(embedTemplates({ sourceType: 'ts'}))
        .pipe(inlineNg2Styles({ base: '/dist/styles', extension: '.scss' }))
        .pipe(gulp.dest('./dist'));
});

But when running I get a SyntaxError: Unexpected token export exception.

stack trace:

SyntaxError: Unexpected token export
    at replace (...\node_modules\gulp-inline-ng2-styles\index.js:88:36)
    at ...\node_modules\gulp-inline-ng2-styles\index.js:74:44
    at Array.forEach (native)
    at inline (...\node_modules\gulp-inline-ng2-styles\index.js:50:9)
    at DestroyableTransform._transform (...\node_modules\gulp-inline-ng2-styles\index.js:30:34)
    at DestroyableTransform.Transform._read (...\node_modules\gulp-inline-ng2-styles\node_modules\readable-stream\lib\_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (...\node_modules\gulp-inline-ng2-styles\node_modules\readable-stream\lib\_stream_transform.js:147:83)
    at doWrite (...\node_modules\gulp-inline-ng2-styles\node_modules\readable-stream\lib\_stream_writable.js:347:64)
    at writeOrBuffer (...\node_modules\gulp-inline-ng2-styles\node_modules\readable-stream\lib\_stream_writable.js:336:5)
    at DestroyableTransform.Writable.write (...\node_modules\gulp-inline-ng2-styles\node_modules\readable-stream\lib\_stream_writable.js:274:11)

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.