Last active
April 22, 2016 09:22
-
-
Save Dreampie/b58dd1152070ecf0f75a4e5fb7200615 to your computer and use it in GitHub Desktop.
angular2+webpack build error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm run build | |
> angular2-demo@0.0.1 build /Users/Dreampie/Projects/DreampieProjects/angular2-demo | |
> webpack --config build/webpack.build.config.js --progress --colors | |
10% 0/1 build modulests-loader: Using typescript@1.8.10 and /Users/Dreampie/Projects/DreampieProjects/angular2-demo/tsconfig.json Hash: 96ae4cbb31fa9aeb69ee | |
Version: webpack 1.13.0 | |
Child | |
Hash: 96ae4cbb31fa9aeb69ee | |
Version: webpack 1.13.0 | |
Time: 3170ms | |
+ 2 hidden modules | |
ERROR in ./src/main.ts | |
Module not found: Error: Cannot resolve module 'angular2/platform/browser' in /Users/Dreampie/Projects/DreampieProjects/angular2-demo/src | |
@ ./src/main.ts 2:16-52 | |
ERROR in ./src/app.component.ts | |
Module not found: Error: Cannot resolve module 'angular2/core' in /Users/Dreampie/Projects/DreampieProjects/angular2-demo/src | |
@ ./src/app.component.ts 2:13-37 | |
Child html-webpack-plugin for "index.html": | |
+ 1 hidden modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {bootstrap} from "angular2/platform/browser"; | |
import {AppComponent} from "./app.component"; | |
bootstrap(AppComponent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "angular2-demo", | |
"version": "0.0.1", | |
"description": "A cms for angular2", | |
"main": "dist/app", | |
"scripts": { | |
"clean": "rm -rf ./dist", | |
"build": "webpack --config build/webpack.build.config.js --progress --colors", | |
"start": "webpack-dev-server --config build/webpack.dev.config.js --progress --colors --inline" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "git+https://github.com/Dreampie/angular2-demo.git" | |
}, | |
"keywords": [ | |
"angular2", | |
"api", | |
"cms" | |
], | |
"license": "MIT", | |
"author": "Dreampie", | |
"bugs": { | |
"url": "https://github.com/Dreampie/angular2-demo/issues" | |
}, | |
"homepage": "https://github.com/Dreampie/angular2-demo#readme", | |
"engines": { | |
"node": ">= 4.2.1", | |
"npm": ">= 3" | |
}, | |
"dependencies": { | |
"angular2": "^2.0.0-beta.15", | |
"es6-promise": "^3.1.2", | |
"es6-shim": "^0.35.0", | |
"reflect-metadata": "0.1.2", | |
"rxjs": "5.0.0-beta.2", | |
"zone.js": "^0.6.12", | |
"@angular2-material/button": "^2.0.0-alpha.3", | |
"@angular2-material/card": "^2.0.0-alpha.3", | |
"@angular2-material/checkbox": "^2.0.0-alpha.3", | |
"@angular2-material/core": "^2.0.0-alpha.3", | |
"@angular2-material/input": "^2.0.0-alpha.3", | |
"@angular2-material/list": "^2.0.0-alpha.3", | |
"@angular2-material/progress-circle": "^2.0.0-alpha.3", | |
"@angular2-material/radio": "^2.0.0-alpha.3", | |
"@angular2-material/sidenav": "^2.0.0-alpha.3", | |
"@angular2-material/toolbar": "^2.0.0-alpha.3" | |
}, | |
"devDependencies": { | |
"webpack": "^1.13.0", | |
"webpack-dev-server": "^1.14.1", | |
"html-webpack-plugin": "^2.16.0", | |
"html-loader": "^0.4.3", | |
"ts-loader": "^0.8.2", | |
"less": "^2.5.3", | |
"less-loader": "^2.2.0", | |
"url-loader": "^0.5.7", | |
"file-loader": "^0.8.5", | |
"typedoc": "^0.3.12", | |
"typescript": "^1.8.10", | |
"typings": "^0.7.12" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require("webpack"); | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
const version = require("../package.json").version; | |
const banner = | |
"/**\n" + | |
" * angular-demo v" + version + "\n" + | |
" * https://github.com/Dreampie/angular2-demo\n" + | |
" * Released under the MIT License.\n" + | |
" */\n"; | |
module.exports = [ | |
{ | |
devtool: 'source-map', | |
entry: { | |
app: "./src/main" | |
}, | |
output: { | |
publicPath: "/", | |
path: "./dist", | |
filename: "js/[name].min.js" | |
}, | |
module: { | |
loaders: [ | |
{test: /\.less/, loader: 'style!css!less'}, | |
{test: /\.html$/, loader: "html"}, | |
{test: /\.ts/, loader: 'ts'}, | |
{test: /\.(eot|svg|ttf)$/, loader: "file"}, | |
{test: /\.(woff|woff2)$/, loader: "url?limit=10000&minetype=application/font-woff"}, | |
{test: /\.(png|jpg|gif)$/, loader: "url"} | |
] | |
}, | |
resolve: { | |
modulesDirectories: ['node_modules'], | |
extensions: ['', '.html', '.less', '.ts'] | |
}, | |
plugins: [ | |
new webpack.BannerPlugin(banner, {raw: true}), | |
new HtmlWebpackPlugin({inject: false, template: 'src/index.html'}), | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin() | |
] | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment