Skip to content

Commit

Permalink
webpack++
Browse files Browse the repository at this point in the history
  • Loading branch information
jonyrock committed Aug 13, 2019
1 parent ed3f22b commit 210261c
Show file tree
Hide file tree
Showing 7 changed files with 579 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
node_modules
node_modules
dist/*
8 changes: 8 additions & 0 deletions app.js
@@ -0,0 +1,8 @@
var express = require('express');
var app = express();

app.get('/', function(req, res){
res.send("Hello world!");
});

app.listen(3000);
19 changes: 19 additions & 0 deletions build/webpack.base.conf.js
@@ -0,0 +1,19 @@
const path = require('path');


function resolve(p) {
return path.resolve(__dirname, './../', p);
}

module.exports = {
target: 'node',
node: {
__dirname: false,
__filename: false,
},
entry: [ './app.js' ],
output: {
filename: "app.js",
path: resolve('dist')
},
}
5 changes: 5 additions & 0 deletions build/webpack.dev.conf.js
@@ -0,0 +1,5 @@
const base = require('./webpack.base.conf');

base.mode = 'development';

module.exports = base;
5 changes: 5 additions & 0 deletions build/webpack.prod.conf.js
@@ -0,0 +1,5 @@
var base = require('./webpack.base.conf');

base.mode = 'production';

module.exports = base;

0 comments on commit 210261c

Please sign in to comment.