mirror of
https://gitlab.silvrtree.co.uk/martind2000/frontexpress.git
synced 2025-01-10 21:55:08 +00:00
added source map and made lib directory visible for bower deployment #3
This commit is contained in:
parent
2702bb8ff6
commit
6659ca98b7
@ -1,4 +1,5 @@
|
||||
frontexpress.js
|
||||
frontexpress.min.js
|
||||
frontexpress.min.js.map
|
||||
coverage
|
||||
dist
|
@ -1,5 +1,6 @@
|
||||
index.js
|
||||
frontexpress.js
|
||||
frontexpress.min.js
|
||||
frontexpress.min.js.map
|
||||
test
|
||||
coverage
|
@ -22,7 +22,6 @@
|
||||
"**/.*",
|
||||
"index.js",
|
||||
"webpack.config.babel.js",
|
||||
"lib",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
|
3
frontexpress.min.js
vendored
3
frontexpress.min.js
vendored
File diff suppressed because one or more lines are too long
1
frontexpress.min.js.map
Normal file
1
frontexpress.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,33 +1,29 @@
|
||||
import webpack from 'webpack';
|
||||
import path from 'path';
|
||||
|
||||
const entry = path.join(__dirname, 'index.js');
|
||||
const module = {
|
||||
loaders: [{
|
||||
test: /\.js/,
|
||||
loader: 'babel-loader'
|
||||
}]
|
||||
};
|
||||
const output = (min=false) => {
|
||||
const filename = min?'frontexpress.min.js':'frontexpress.js';
|
||||
const script = (name, min=false) => {
|
||||
return {
|
||||
path: __dirname,
|
||||
filename
|
||||
entry: path.join(__dirname, 'index.js'),
|
||||
output: {
|
||||
path: __dirname,
|
||||
filename: min?`${name}.min.js`:`${name}.js`
|
||||
},
|
||||
devtool: min?'source-map':null,
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.js/,
|
||||
loader: 'babel-loader'
|
||||
}]
|
||||
},
|
||||
plugins: !min?[]:[
|
||||
new webpack.optimize.DedupePlugin(),
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.optimize.UglifyJsPlugin(),
|
||||
],
|
||||
};
|
||||
};
|
||||
|
||||
export default [{
|
||||
entry,
|
||||
output: output(true),
|
||||
module,
|
||||
plugins: [
|
||||
new webpack.optimize.DedupePlugin(),
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.optimize.UglifyJsPlugin(),
|
||||
],
|
||||
},
|
||||
{
|
||||
entry,
|
||||
output: output(),
|
||||
module
|
||||
}];
|
||||
export default [
|
||||
script('frontexpress'),
|
||||
script('frontexpress', true)
|
||||
];
|
Loading…
Reference in New Issue
Block a user