-
-
Save SaravananSeenivasan/05261250e652a58039302ab8607f710e to your computer and use it in GitHub Desktop.
webpack demo - project 1
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 { Component } from '@angular/core'; | |
@Component({ | |
moduleId: module.id, | |
selector: 'Root', | |
template: ` <div> | |
<h4>Sample Component</h4> | |
<dfn> {{sample_def}} </dfn> | |
</div> | |
` | |
}) | |
export class Rootcomponent { | |
sample_def = "Sample data rendered from component"; | |
constructor() { | |
console.log("Root"); | |
} | |
} |
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
var webpack = require("webpack"); | |
var path = require("path"); | |
module.exports = { | |
entry: { | |
'app': './app/app.module.ts' | |
}, | |
output: { | |
filename: '[name]/dist/bundle.js', | |
libraryTarget: "umd" | |
}, | |
module: { | |
loaders: [{ | |
test: /\.css$/, | |
exclude: /node_modules/, | |
loader: 'style!css' | |
}, | |
{ | |
test: /\.html$/, | |
loader: "html" | |
}, | |
{ | |
test: /\.ts$/, | |
loader: 'awesome-typescript-loader' | |
}, | |
], | |
}, | |
resolve: { | |
extensions: ['', '.ts', '.js'] | |
}, | |
htmlLoader: { | |
ignoreCustomFragments: [/\{\{.*?}}/], | |
root: path.resolve(__dirname, 'assets'), | |
attrs: ['img:src', 'link:href'] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment