Add webpack

This commit is contained in:
tkqubo
2015-09-23 19:22:13 +09:00
parent 32029fcb4e
commit d12ff571bf
2 changed files with 100 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
/// <reference path="webpack.d.ts" />
import webpack from 'webpack';
//import webpack = require('webpack');
var configuration: webpack.Configuration;
var loader: webpack.Loader;
var plugin: webpack.Plugin;
//
// https://webpack.github.io/docs/using-loaders.html
//
configuration = {
module: {
loaders: [
{ test: /\.jade$/, loader: "jade" },
// => "jade" loader is used for ".jade" files
{ test: /\.css$/, loader: "style!css" },
// => "style" and "css" loader is used for ".css" files
// Alternative syntax:
{ test: /\.css$/, loaders: ["style", "css"] },
]
}
};
loader = { test: /\.png$/, loader: "url-loader?mimetype=image/png" };
loader = {
test: /\.png$/,
loader: "url-loader",
query: { mimetype: "image/png" }
};
//
// https://webpack.github.io/docs/using-plugins.html
//
configuration = {
plugins: [
new webpack.ResolverPlugin([
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
], ["normal", "loader"])
]
};