Skip to content

Commit

Permalink
Updated for 19
Browse files Browse the repository at this point in the history
  • Loading branch information
Basiczombie committed Jul 11, 2019
1 parent 90ddf29 commit 1b3e2ac
Show file tree
Hide file tree
Showing 11 changed files with 5,398 additions and 1,436 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function (api) {
api.cache(true);

const presets = ['@babel/preset-env'];
const plugins = [];

return {
presets,
plugins
};
}
23 changes: 23 additions & 0 deletions gulp.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"image_server_name": {
"ps_url": "",
"deploy_credentials": {
"host": "",
"user": "",
"pass": "",
"remotePath": ""
}
},

"image_server_name2": {
"ps_url": "https://ps.example.com",
"deploy_credentials": {
"host": "sftp_host",
"user": "user",
"pass": "password",
"remotePath": "/path/to/assets/folder"
}
},

"default_deploy_target": "image_server_name"
}
8 changes: 5 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import gulp from 'gulp';
import psTasks from 'gulp-ps-tasks';
import * as psTasks from 'gulp4-ps-tasks'

psTasks(gulp, __dirname);
// Parse the exports gulp tasks from index.js
Object.keys(psTasks).forEach(key => {
module.exports[key] = psTasks[key]
})
29 changes: 23 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,28 @@
},
"homepage": "https://github.com/IronCountySchoolDistrict/list-students-autoloader#readme",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.51",
"@babel/preset-es2015": "^7.0.0-beta.51",
"@babel/register": "^7.0.0-beta.51",
"babel-eslint": "^8.0.3",
"gulp": "^3.9.1",
"gulp-ps-tasks": "^0.7.0"
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/plugin-transform-modules-amd": "^7.2.0",
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
"@babel/plugin-transform-regenerator": "^7.4.5",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.3.4",
"@babel/register": "^7.0.0",
"babel-loader": "^8.0.6",
"css-loader": "^3.0.0",
"gulp": "^4.0.2",
"gulp4-ps-tasks": "^0.1.8",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.7.0",
"pkginfo": "^0.4.1",
"sass-loader": "^7.1.0",
"underscore": "^1.9.1",
"webpack": "^4.35.0",
"webpack-merge": "^4.2.1"
},
"dependencies": {
"@babel/runtime": "^7.4.5"
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link href="/scripts/list-students-autoloader/css/print-list.css" rel="stylesheet" media="print">
<link href="/scripts/list-students-autoloader/css/autoloader.css" rel="stylesheet" media="print">
1 change: 1 addition & 0 deletions src/scripts/list-students-autoloader/js/autoloader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import _ from 'underscore';
import $ from 'jquery';
import '../css/print-list.css'

export default function() {
var template = $($('#template').html());
Expand Down
74 changes: 74 additions & 0 deletions webpack.common.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import path from 'path'
import webpack from 'webpack'
import pkgInfo from 'pkginfo'

pkgInfo(module)

const config = {
entry: {
'autoloader': `./src/scripts/${module.exports.name}/js/autoloader.js`,
},
performance: {
hints: false
},
externals: {
jquery: 'jquery',
underscore: 'underscore'
},
optimization: {
splitChunks: {
name: true,
cacheGroups: {
index: {
test: /static\/js/
},
vendors: {
test: /([\\/]node_modules[\\/])/,
name: 'vendor',
chunks: 'all'
}
}
}
},
module: {
rules: [
{
test: /\.(html)$/,
use: {
loader: 'html-loader',
options: { minimize: true }
}
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: [
"@babel/plugin-transform-modules-amd",
"@babel/plugin-transform-regenerator",
"@babel/plugin-transform-runtime",
]
}
}
]
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
createDayLabel: "jquery",
createWeekdayLabel: "jquery"
}),
],
resolve: {
modules: ['src', 'node_modules'],
extensions: ['.js', '.css'],
}

}

export default config
73 changes: 73 additions & 0 deletions webpack.dev.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import path from 'path'
import webpack from 'webpack'
import merge from 'webpack-merge'
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import DashboardPlugin from 'webpack-dashboard/plugin'
import BrowserSyncPlugin from 'browser-sync-webpack-plugin'

import common from './webpack.common.babel'

export default merge(common, {
devtool: 'inline-source-map',
mode: 'development',
output: {
path: path.resolve(__dirname, './src/public/dist/'),
filename: `[name].bundle.js`,
publicPath: '/'
},
module: {
rules: [
{
test: /\.(sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
includePaths: [
path.resolve(__dirname, 'node_modules/')
]
}
},
'css-loader',
'sass-loader'
]
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin({ multiStep: true }),
new MiniCssExtractPlugin({
filename: '[name].bundle.css'
}),
new HtmlWebpackPlugin({
template: './src/html/template.html',
inject: 'body'
}),
new BrowserSyncPlugin({
host: '0.0.0.0',
port: 3001,
proxy: 'http://localhost:3000/',
reload: false,
open: false
})
],
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
},
contentBase: './src/public',
compress: true,
host: '0.0.0.0',
port: '3000',
bonjour: true,
hot: true,
historyApiFallback: true,
inline: true,
clientLogLevel: 'error',
watchOptions: {
aggregateTimeout: 500,
poll: 1000
}
}
})
45 changes: 45 additions & 0 deletions webpack.prod.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import path from 'path'
import webpack from 'webpack'
import merge from 'webpack-merge'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import pkgInfo from 'pkginfo'

import common from './webpack.common.babel'

pkgInfo(module)

export default merge(common, {
mode: 'production',
// devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist/web_root'),
filename: `scripts/${module.exports.name}/js/[name].js`,
publicPath: 'https://ps.irondistrict.org',
library: 'autoloader',
libraryTarget: 'amd'
},
module: {
rules: [
{
test: /\.(sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
includePaths: [
path.resolve(__dirname, 'node_modules/')
]
}
},
'css-loader',
'sass-loader'
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: `scripts/${module.exports.name}/css/[name].css`
})
]
})
Loading

0 comments on commit 1b3e2ac

Please sign in to comment.