From 87411236e302329c40791e489223cf7ef5a42747 Mon Sep 17 00:00:00 2001 From: ronreg-ribdev Date: Sun, 29 Nov 2020 23:01:43 -0800 Subject: [PATCH] Add new just-based flow for putting files into pier --- gall-app/package.json | 3 +- gall-app/webpack.development.dev.js | 53 +++++++++++++++++++++++++++++ justfile | 2 +- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 gall-app/webpack.development.dev.js diff --git a/gall-app/package.json b/gall-app/package.json index 35bedad..a183ef5 100644 --- a/gall-app/package.json +++ b/gall-app/package.json @@ -6,7 +6,8 @@ "scripts": { "start": "node install.js", "serve": "cross-env NODE_ENV=development webpack-dev-server --config webpack.dev.js", - "build": "cross-env NODE_ENV=production webpack --config webpack.prod.js" + "build": "cross-env NODE_ENV=production webpack --config webpack.prod.js", + "build-development": "cross-env NODE_ENV=production webpack --config webpack.development.dev.js" }, "author": "Tlon Corp", "license": "MIT", diff --git a/gall-app/webpack.development.dev.js b/gall-app/webpack.development.dev.js new file mode 100644 index 0000000..a9c95a5 --- /dev/null +++ b/gall-app/webpack.development.dev.js @@ -0,0 +1,53 @@ +const path = require('path'); +const urbitrc = require('./urbitrc'); + +module.exports = { + mode: 'production', + entry: { + app: './src/index.js' + }, + module: { + rules: [ + { + test: /\.jsx?$/, + use: { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env', '@babel/preset-react'], + plugins: [ + '@babel/transform-runtime', + '@babel/plugin-proposal-object-rest-spread', + '@babel/plugin-proposal-optional-chaining', + '@babel/plugin-proposal-class-properties' + ] + } + }, + exclude: /node_modules/ + }, + { + test: /\.css$/i, + use: [ + // Creates `style` nodes from JS strings + 'style-loader', + // Translates CSS into CommonJS + 'css-loader', + // Compiles Sass to CSS + 'sass-loader' + ] + } + ] + }, + resolve: { + extensions: ['.js'] + }, + devtool: 'inline-source-map', + output: { + filename: 'bundle.js', + path: path.resolve('./urbit/app/browsermanager/js'), + publicPath: '/', + }, + optimization: { + minimize: false, + usedExports: true + } +}; diff --git a/justfile b/justfile index b932295..ab74192 100644 --- a/justfile +++ b/justfile @@ -3,4 +3,4 @@ copy-to-pier: cp -r gall-app/urbit/* $PIER build-javascript: - yarn --cwd gall-app run build + yarn --cwd gall-app run build-development