Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
upgrade source-maps example
Browse files Browse the repository at this point in the history
  • Loading branch information
amireh committed Mar 4, 2018
1 parent 40629a0 commit 0616a9d
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 59 deletions.
1 change: 1 addition & 0 deletions examples/source-maps/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
diff ./happy/main.js.map ./vanilla/main.js.map
33 changes: 33 additions & 0 deletions examples/source-maps/versions/1/happy/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const path = require('path');
const e = require('@happypack/example-utils');
const { HappyPack } = e;

module.exports = ({
context: path.resolve(__dirname),
entry: e.resolve(module, 'lib/a.js'),
devtool: 'source-map',

output: {
path: e.outputDir(module),
filename: '[name].js'
},

plugins: [
new HappyPack({
loaders: [
e.resolve(module, 'identity-loader.js'),
'babel',
],
threads: 2
})
],

module: {
loaders: [
{
test: /\.js$/,
loaders: [ e.happyLoader ]
}
]
}
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "happypack-examples__source-maps",
"name": "@happypack-examples/source-maps--webpack-1",
"private": true,
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand Down
25 changes: 25 additions & 0 deletions examples/source-maps/versions/1/vanilla/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const path = require('path');
const e = require('@happypack/example-utils');

module.exports = ({
context: path.resolve(__dirname),
entry: e.resolve(module, 'lib/a.js'),
devtool: 'source-map',

output: {
path: e.outputDir(module),
filename: '[name].js'
},

module: {
loaders: [
{
test: /\.js$/,
loaders: [
e.resolve(module, 'identity-loader.js'),
'babel'
]
}
]
}
});
34 changes: 34 additions & 0 deletions examples/source-maps/versions/4/happy/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const path = require('path');
const e = require('@happypack/example-utils');
const { HappyPack } = e;

module.exports = ({
context: path.resolve(__dirname),
entry: e.resolve(module, 'lib/a.js'),
mode: 'development',
devtool: 'source-map',

output: {
path: e.outputDir(module),
filename: '[name].js'
},

plugins: [
new HappyPack({
rules: [
e.resolve(module, 'identity-loader.js'),
'babel-loader',
],
threads: 2
})
],

module: {
rules: [
{
test: /\.js$/,
use: [ e.happyLoader ]
}
]
}
});
8 changes: 8 additions & 0 deletions examples/source-maps/versions/4/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@happypack-examples/source-maps--webpack-4",
"private": true,
"dependencies": {
"babel-core": "6.26.0",
"babel-loader": "7.1.3"
}
}
26 changes: 26 additions & 0 deletions examples/source-maps/versions/4/vanilla/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const path = require('path');
const e = require('@happypack/example-utils');

module.exports = ({
context: path.resolve(__dirname),
entry: e.resolve(module, 'lib/a.js'),
devtool: 'source-map',
mode: 'development',

output: {
path: e.outputDir(module),
filename: '[name].js'
},

module: {
rules: [
{
test: /\.js$/,
use: [
e.resolve(module, 'identity-loader.js'),
'babel-loader'
]
}
]
}
});
25 changes: 0 additions & 25 deletions examples/source-maps/webpack.config--raw.js

This file was deleted.

33 changes: 0 additions & 33 deletions examples/source-maps/webpack.config.js

This file was deleted.

0 comments on commit 0616a9d

Please sign in to comment.