Skip to content
Permalink
Browse files

test_module

  • Loading branch information...
jonyrock committed Aug 13, 2019
1 parent 210261c commit d3c564d7832055a02eb3d357e35d2e3cd8b64cf3
Showing with 27 additions and 8 deletions.
  1. +5 −2 README.md
  2. +7 −1 app.js
  3. +9 −0 build/webpack.dev.conf.js
  4. +5 −5 package.json
  5. +1 −0 test_module.js
@@ -1,2 +1,5 @@
# express-webpack-example
Repo showing how to bundle an express.js application to a bundle with webpack
# Express Webpack example
Repo showing how to bundle an [Express.js](https://github.com/expressjs/express)
application to a bundle with [Webpack](https://github.com/webpack/webpack).

Project has production and development build.
8 app.js
@@ -1,8 +1,14 @@
import { MODULE_CONST } from './test_module'

var express = require('express');
var app = express();

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

app.get('/test-module', function(req, res) {
res.send(MODULE_CONST);
});

app.listen(3000);
@@ -1,5 +1,14 @@
const base = require('./webpack.base.conf');

base.mode = 'development';
base.externals = [
function(context, request, callback) {
if(request[0] == '.') {
callback();
} else {
callback(null, "require('" + request + "')");
}
}
],

module.exports = base;
@@ -4,10 +4,9 @@
"description": "Repo showing how to bundle an express.js application to a bundle with webpack",
"main": "app.js",
"scripts": {
"start": "node dist/server.js",
"start": "node dist/app.js",
"build": "webpack --config build/webpack.prod.conf.js",
"dev": "webpack --config build/webpack.dev.conf.js",
"test": "echo \"Error: no test specified\" && exit 1"
"dev": "webpack --config build/webpack.dev.conf.js"
},
"repository": {
"type": "git",
@@ -16,8 +15,9 @@
"keywords": [
"node.js",
"webpack",
"express.js",
"javascript"
"expressjs",
"javascript",
"cicd"
],
"author": "CorpGlory Inc.",
"license": "MIT",
@@ -0,0 +1 @@
export const MODULE_CONST = "Hello from the test module";

0 comments on commit d3c564d

Please sign in to comment.
You can’t perform that action at this time.