Last active
May 3, 2016 21:34
-
-
Save jklmli/a5401430dc85d7e3f28cef7286e6e872 to your computer and use it in GitHub Desktop.
webpack.config.json
This file contains hidden or 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 path = require('path'); | |
//var HappyPack = require('happypack'); | |
//var ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin; | |
var LessAutoprefixer = require('less-plugin-autoprefix'); | |
//var webpack = require('webpack'); | |
module.exports = { | |
entry: './front/src/js/app/app.ts', | |
output: { | |
filename: 'bundle.js' | |
}, | |
devtool: //'eval', | |
'inline-cheap-module-eval-source-map', | |
resolve: { | |
extensions: ['', '.ts', '.less', '.coffee', '.js', '.css', '.json'], | |
modulesDirectories: ['node_modules'] | |
}, | |
module: { | |
loaders: [ | |
{ test: /\.less$/, loader: 'style!css!less'}, | |
{ test: /\.coffee$/, loader: 'coffee-loader' }, | |
{ test: /\.json$/, loader: 'json-loader' }, | |
{ test: /\.ts$/, loader: 'ts-loader' }, | |
{ test: /\.svg$/, loader: 'svg-inline' }, | |
{ test: /\.html$/, loader: 'underscore-template-loader' }, | |
{ test: /\.htm$/, loader: 'raw-loader' }, | |
{ test: /\.css$/, loader: 'style!css' },//, | |
//{ test: /\.coffee$/, loader: 'happypack/loader?id=coffee' }, | |
//{ test: /\.html$/, loader: 'happypack/loader?id=underscore-template' }, | |
//{ test: /\.less$/, loader: 'happypack/loader?id=less' }, | |
//{ test: /\.css$/, loader: 'happypack/loader?id=css' }, | |
//{ test: /\.ts$/, loader: 'happypack/loader?id=ts' }, | |
//{ test: /\.htm$/, loader: 'happypack/loader?id=rivets' } | |
] | |
}, | |
plugins: [ | |
//new ForkCheckerPlugin() | |
/*new HappyPack({ | |
id: 'coffee', | |
threads: 4, | |
loaders: ['coffee-loader'] | |
}), | |
new HappyPack({ | |
id: 'underscore-template', | |
threads: 4, | |
loaders: ['underscore-template-loader'] | |
}), | |
new HappyPack({ | |
id: 'rivets', | |
threads: 4, | |
loaders: ['raw-loader'] | |
}), | |
new HappyPack({ | |
id: 'json', | |
threads: 4, | |
loaders: ['json-loader'] | |
}) | |
/*, | |
new HappyPack({ | |
id: 'ts', | |
threads: 4, | |
loaders: ['ts-loader'] | |
}), | |
new HappyPack({ | |
id: 'css', | |
threads: 4, | |
loaders: ['style!css'] | |
}), | |
new HappyPack({ | |
id: 'less', | |
threads: 4, | |
loaders: ['style!css!less'] | |
})*/ | |
], | |
lessLoader: { | |
lessPlugins: [ | |
new LessAutoprefixer({ | |
browsers: ['> 1%'] | |
}) | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment