Merge pull request #390 from standardnotes/webpack-dev-server
Add webpack dev server
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -35,4 +35,4 @@ dump.rdb
|
|||||||
/public/uploads/*
|
/public/uploads/*
|
||||||
!/public/uploads/.keep
|
!/public/uploads/.keep
|
||||||
|
|
||||||
.vscode
|
.vscode
|
||||||
|
|||||||
@@ -60,16 +60,16 @@ This repo contains the core code used in the web app, as well as the Electron-ba
|
|||||||
**Instructions:**
|
**Instructions:**
|
||||||
|
|
||||||
1. Clone the repo
|
1. Clone the repo
|
||||||
1. `npm run build`
|
2. `npm install`
|
||||||
1. `rails s`
|
3. `npm start`
|
||||||
|
|
||||||
Open your browser to http://localhost:3000.
|
Then open your browser to `http://localhost:3000`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Extensions Manager and Batch Manager:**
|
**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. `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:
|
1. Set the following environment variables in the .env file:
|
||||||
|
|||||||
1296
package-lock.json
generated
1296
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
|||||||
"url": "https://github.com/standardnotes/web"
|
"url": "https://github.com/standardnotes/web"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack --mode development -w",
|
"start": "webpack-dev-server --progress",
|
||||||
"bundle": "webpack --mode production",
|
"bundle": "webpack --mode production",
|
||||||
"build": "bundle install && npm install && npm run bundle",
|
"build": "bundle install && npm install && npm run bundle",
|
||||||
"submodules": "git submodule update --init --force --remote",
|
"submodules": "git submodule update --init --force --remote",
|
||||||
@@ -49,7 +49,8 @@
|
|||||||
"sn-stylekit": "2.0.22",
|
"sn-stylekit": "2.0.22",
|
||||||
"snjs": "1.0.6",
|
"snjs": "1.0.6",
|
||||||
"webpack": "^4.41.5",
|
"webpack": "^4.41.5",
|
||||||
"webpack-cli": "^3.3.10"
|
"webpack-cli": "^3.3.10",
|
||||||
|
"webpack-dev-server": "^3.10.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash": "^4.17.15"
|
"lodash": "^4.17.15"
|
||||||
|
|||||||
@@ -7,6 +7,15 @@ module.exports = {
|
|||||||
output: {
|
output: {
|
||||||
filename: './javascripts/app.js'
|
filename: './javascripts/app.js'
|
||||||
},
|
},
|
||||||
|
devServer: {
|
||||||
|
proxy: {
|
||||||
|
'/extensions': {
|
||||||
|
target: 'http://localhost:3000',
|
||||||
|
pathRewrite: { '^/extensions': '/public/extensions' }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
port: 3000
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__VERSION__: JSON.stringify(require('./package.json').version)
|
__VERSION__: JSON.stringify(require('./package.json').version)
|
||||||
|
|||||||
Reference in New Issue
Block a user