Merge pull request #390 from standardnotes/webpack-dev-server

Add webpack dev server
This commit is contained in:
Mo Bitar
2020-03-12 13:29:24 -05:00
committed by GitHub
5 changed files with 1313 additions and 7 deletions

2
.gitignore vendored
View File

@@ -35,4 +35,4 @@ dump.rdb
/public/uploads/*
!/public/uploads/.keep
.vscode
.vscode

View File

@@ -60,16 +60,16 @@ This repo contains the core code used in the web app, as well as the Electron-ba
**Instructions:**
1. Clone the repo
1. `npm run build`
1. `rails s`
2. `npm install`
3. `npm start`
Open your browser to http://localhost:3000.
Then open your browser to `http://localhost:3000`.
---
**Extensions Manager and Batch Manager:**
The web app makes use of two optional native extensions, which can be configured to work as follows:
The web app makes use of two optional native extensions, which, when running the app with Rails, can be configured to work as follows:
1. `git submodule update --init --force --remote` (will load the submodules in the `public/extensions` folder)
1. Set the following environment variables in the .env file:

1296
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
"url": "https://github.com/standardnotes/web"
},
"scripts": {
"start": "webpack --mode development -w",
"start": "webpack-dev-server --progress",
"bundle": "webpack --mode production",
"build": "bundle install && npm install && npm run bundle",
"submodules": "git submodule update --init --force --remote",
@@ -49,7 +49,8 @@
"sn-stylekit": "2.0.22",
"snjs": "1.0.6",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"lodash": "^4.17.15"

View File

@@ -7,6 +7,15 @@ module.exports = {
output: {
filename: './javascripts/app.js'
},
devServer: {
proxy: {
'/extensions': {
target: 'http://localhost:3000',
pathRewrite: { '^/extensions': '/public/extensions' }
}
},
port: 3000
},
plugins: [
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(require('./package.json').version)