Sample changes for module loading.

Sample changes for module loading.
This commit is contained in:
Abinaya Subbiah 2017-05-10 12:46:32 +05:30
Родитель c7c16b9fdd
Коммит 01a9d314b0
5 изменённых файлов: 42 добавлений и 26 удалений

Просмотреть файл

@ -11,37 +11,50 @@ module.exports = {
},
resolve: {
extensions: ['', '.js', '.ts']
extensions: ['.ts', '.js']
},
module: {
loaders: [
rules: [
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader']
loaders: [
{
loader: 'awesome-typescript-loader',
options: { configFileName: helpers.root('src', 'tsconfig.json') }
} , 'angular2-template-loader'
]
},
{
test: /\.html$/,
loader: 'html'
loader: 'html-loader'
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file?name=assets/[name].[hash].[ext]'
test: /\.(png|jpe?g|gif|cur|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
},
{
test: /\.css$/,
exclude: helpers.root('src', 'app'),
loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?sourceMap' })
},
{
test: /\.css$/,
include: helpers.root('src', 'app'),
loader: 'raw'
loader: 'raw-loader'
}
]
},
plugins: [
// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills']
}),
@ -51,3 +64,4 @@ module.exports = {
})
]
};

Просмотреть файл

@ -39,13 +39,13 @@
"zone.js": "^0.7.4"
},
"devDependencies": {
"angular2-template-loader": "^0.4.0",
"awesome-typescript-loader": "^3.0.0-beta.17",
"css-loader": "^0.23.1",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^3.0.4",
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "2.0.0-beta.5",
"file-loader": "^0.9.0",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.15.0",
"html-webpack-plugin": "^2.16.1",
"jasmine-core": "^2.4.1",
"karma": "^1.2.0",
"karma-jasmine": "^1.0.2",
@ -54,13 +54,15 @@
"karma-webpack": "^1.8.0",
"null-loader": "^0.1.1",
"phantomjs-prebuilt": "^2.1.7",
"protractor": "~4.0.14",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.2",
"rimraf": "^2.5.4",
"style-loader": "^0.13.1",
"typescript": "^2.1.4",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.14.0",
"typescript": "~2.2.0",
"url-loader": "^0.5.8",
"webpack": "2.2.1",
"webpack-dev-server": "2.4.1",
"webpack-merge": "^3.0.0",
"bootstrap": "^3.3.6",
"jquery": "^3.1.1",
"jsrender": "^0.9.75",

Просмотреть файл

@ -9,11 +9,6 @@
<link rel="shortcut icon" type="image/png" href="deps/images/favicon.ico">
<link href="src/deps/default.css" rel="stylesheet" />
<link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="../node_modules/syncfusion-javascript/Content/ej/web/material/ej.web.all.min.css" />
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../node_modules/jsrender/jsrender.min.js"></script>
<script src="../node_modules/syncfusion-javascript/Scripts/ej/web/ej.web.all.min.js"> </script>
</head>
<body>

Просмотреть файл

@ -10,7 +10,7 @@
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"node_modules/@types/"
"./../node_modules/@types/"
],
"types": [
"jquery",
@ -19,4 +19,4 @@
"es6-shim"
]
}
}
}

Просмотреть файл

@ -9,3 +9,8 @@ import '@angular/router';
import 'rxjs';
// Other vendors for example jQuery, Lodash or Bootstrap
// You can import js, ts, css, sass, ...
import * as $ from 'jquery';
window["jQuery"] = $;
window["$"] = $;
import 'jsrender';
import '../node_modules/syncfusion-javascript/Content/ej/web/material/ej.web.all.min.css';