bolt/@boltlang/compiler/webpack.config.js
Sam Vervaeck 2b2d40c4f5 Major restructuring and update to code base
- Created a new VSCode Extension subproject
 - Created a new Bolt CLI subproject
 - Created a new Bolt Language Server subproject
 - Created a new Bolt Compiler subproject
 - Moved most existing code to the new Compiler subproject
 - Added a small language server
 - Laid the foundations for a Hindley-Milner type checker
 - Fixed some bugs and type errors in the compiler
 - Removed the unused testing infrastructure
 - Added an example parser test that should be run with Ava
2020-11-15 09:57:25 +01:00

40 lines
946 B
JavaScript

const fs = require('fs');
const webpack = require("webpack");
const path = require("path");
function zip(entries) {
const obj = {};
for (const [k, v] of entries) {
obj[k] = v;
}
return obj;
}
module.exports = {
target: 'node',
mode: 'development',
entry: {
'bolt-langserver': './src/main.ts'
},
output: {
filename: 'bin/[name].js',
path: path.resolve(__dirname, 'build'),
devtoolModuleFilenameTemplate: '[absolute-resource-path]'
},
resolve: {
extensions: [".ts", ".js"],
},
externals: zip(fs.readdirSync('node_modules').map(m => [m, `commonjs ${m}`])),
plugins: [
new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),
],
devtool: 'source-map',
module: {
rules: [
{ test: /\.ts$/, exclude: /node_modules/, loader: "ts-loader", options: { transpileOnly: true } },
{ test: /\.m?js$/, exclude: /node_modules/, loader: 'babel-loader' },
]
}
};