1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-22 18:11:43 +03:00
tabby/webpack.config.js
Eugene Pankov 98fea7b102 .
2016-12-23 10:06:53 +01:00

99 lines
2.7 KiB
JavaScript

const path = require("path")
const webpack = require("webpack")
module.exports = {
target: 'node',
entry: {
'index.ignore': 'file-loader?name=index.html!val-loader!pug-html-loader!./app/index.pug',
'preload': './app/src/entry.preload.ts',
'bundle': './app/src/entry.ts',
},
devtool: 'source-map',
output: {
path: 'app/assets/webpack',
pathinfo: true,
//publicPath: 'assets/webpack/',
filename: '[name].js'
},
resolve: {
modules: ['app/src/', 'node_modules', 'app/assets/'],
extensions: ['.ts', '.js'],
},
module: {
loaders: [
{
test: /\.ts$/,
loader: 'awesome-typescript-loader'
},
{
test: /\.pug$/,
exclude: [
/index.pug/
],
loaders: [
{
loader: 'apply-loader'
},
{
loader: 'pug-loader'
}
]
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
{
test: /\.less$/,
loader: "style-loader!css-loader!less-loader",
exclude: [/app\/src\/components\//],
},
{
test: /\.less$/,
loader: "to-string-loader!css-loader!less-loader",
include: [/app\/src\/components\//],
},
{
test: /\.(png|svg)$/,
loader: "file-loader",
query: {
name: 'images/[name].[hash:8].[ext]'
}
},
{
test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader",
query: {
name: 'fonts/[name].[hash:8].[ext]'
}
},
]
},
externals: {
'electron': 'require("electron")',
'net': 'require("net")',
'remote': 'require("remote")',
'shell': 'require("shell")',
'ipc': 'require("ipc")',
'fs': 'require("fs")',
'buffer': 'require("buffer")',
'pty.js': 'require("pty.js")',
'system': '{}',
'file': '{}'
},
plugins: [
new webpack.ProvidePlugin({
"window.jQuery": "jquery",
}),
]
}
if (!process.env.DEV) {
module.exports.plugins.push(new webpack.LoaderOptionsPlugin({
minimize: true,
}))
module.exports.plugins.push(new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
mangle: false,
}))
module.exports.devtool = 'source-map'
}