Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #11 from ryangittings/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ryangittings authored May 14, 2020
2 parents 5fb6a5c + 9c0efb0 commit fdf61f2
Show file tree
Hide file tree
Showing 5 changed files with 461 additions and 909 deletions.
39 changes: 18 additions & 21 deletions assets/js/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 0 additions & 100 deletions dist/assets/src/js/main.js

This file was deleted.

42 changes: 11 additions & 31 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,18 @@ const paths = {

// Minify Javascript files
$.gulp.task('scripts', function () {
const isProduction = (process.env.NODE_ENV === 'production');
var b = $.browserify({
entries: `${paths.scripts.src}/main.js`,
debug: true,
}).transform("babelify", {presets: ["@babel/preset-env"]});

const config = {
entry: `${paths.scripts.src}/main.js`,
output: {
filename: 'main.js',
path: `${__dirname}/${paths.scripts.dest}`,
},
mode: isProduction ? 'production' : 'development',
module: {
rules: [
{
test: /^(?!.*\.{test,min}\.js$).*\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
],
},
};

return new Promise(resolve => $.webpack(config, (err, stats) => {
if (err) console.log('Webpack', err);

console.log(stats.toString({ /* stats options */ }));

resolve();
}));
return b.bundle()
.pipe($.plumber())
.pipe($.vinylSourceStream('main.js'))
.pipe($.vinylBuffer())
.pipe($.sourcemaps.init({loadMaps: true}))
.pipe($.sourcemaps.write('./'))
.pipe($.gulp.dest(paths.scripts.dest));
});

// Compiles sass into Assets
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"devDependencies": {
"@babel/core": "^7.8.6",
"@babel/preset-env": "^7.8.6",
"babel-loader": "^8.1.0",
"babelify": "^10.0.0",
"browser-sync": "^2.26.7",
"browserify": "^16.5.0",
"cssnano": "^4.1.10",
"del": "^5.1.0",
"goron": "^0.1.1",
Expand All @@ -36,6 +37,7 @@
"gulp-sourcemaps": "^2.6.5",
"gulp-uglify": "^3.0.2",
"postcss-import": "^12.0.1",
"webpack": "^4.42.1"
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
}
}
Loading

0 comments on commit fdf61f2

Please sign in to comment.