Skip to content

SyntaxError: Unexpected token import (import {AotPlugin} from '@ngtools/webpack') #7294

@IAMtheIAM

Description

@IAMtheIAM

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

npm -v
4.6.1

node -v
v6.10.0

webpack version 3.4.1

Repro steps.

Following the documentation readme instructions, Adding this to webpack config file causes immediate compilation error

import {AotPlugin} from '@ngtools/webpack';

The log given by the failure.

import {AotPlugin} from '@ngtools/webpack'
^^^^^^
SyntaxError: Unexpected token import
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions