p5.js-web-editor/webpack/config.examples.js
Joey Lee a5753b5e4c Script to fetch ml5 examples from Github Repo (#1051)
* replaced () with {} to fix implicit return error

* added first version of fetching generative-design examples

* ignore local testing files

* formatting

* updated examples-gg-latest

* updated examples-gg-latest.js

- data files not served via rawgit - hallelujah!
- added jquery

* updated p5 version

* refactoring and code cleanup

* added comment

* comment out link to svgFiles - unused

* moved commented code

* fixed conflicts

* linted examples-gg-latest

* removed console.log of response.data to prevent logging user data to console

* fixed linting error

* initial commit for setting up automated ml5 example fetching

* rm logs from .env replaced with placeholder

* added functions for retrieving all assets from examples sketches

* added recursive walk through to get all directories and files

* added functions t format files for making project

* added full working test

* added comments and formated code

* added comments

* set username at to of code

* added process.exit() on complete

* added linting and fixed errors

* rm await in return

* added es lint disable for reduce()

* rm package-lock.json

* reset package-lock.json to master

* "updated .env.example with dummy logins"

* updated .env.example for consistency

* added p5 user checking

* fixed linting issues

* add webpack config to build ml5 example fetching bundle
2019-05-02 15:12:06 -04:00

138 lines
No EOL
2.6 KiB
JavaScript

const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = [{
entry: path.resolve(__dirname, '../server/scripts/fetch-examples.js'),
output: {
path: path.resolve(__dirname, '../dist/'),
filename: 'fetch-examples.bundle.js'
},
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['*', '.js', '.jsx'],
modules: [
'client',
'node_modules',
],
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: [
'react',
'env',
'stage-0',
],
plugins: [
[
'babel-plugin-webpack-loaders', {
'config': path.resolve(__dirname, './config.babel.js'),
"verbose": false
}
]
]
},
}
],
},
},
{
entry: path.resolve(__dirname, '../server/scripts/fetch-examples-gg.js'),
output: {
path: path.resolve(__dirname, '../dist/'),
filename: 'fetch-examples-gg.bundle.js'
},
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['*', '.js', '.jsx'],
modules: [
'client',
'node_modules',
],
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: [
'react',
'env',
'stage-0',
],
plugins: [
[
'babel-plugin-webpack-loaders', {
'config': path.resolve(__dirname, './config.babel.js'),
"verbose": false
}
]
]
},
}
],
},
},
{
entry: path.resolve(__dirname, '../server/scripts/fetch-examples-ml5.js'),
output: {
path: path.resolve(__dirname, '../dist/'),
filename: 'fetch-examples-ml5.bundle.js'
},
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['*', '.js', '.jsx'],
modules: [
'client',
'node_modules',
],
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: [
'react',
'env',
'stage-0',
],
plugins: [
[
'babel-plugin-webpack-loaders', {
'config': path.resolve(__dirname, './config.babel.js'),
"verbose": false
}
]
]
},
}
],
},
}];