mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Build assets to tmp/static_dev in development
This commit is contained in:
parent
7e4eccbf6d
commit
406c17dc43
|
@ -10,6 +10,5 @@ erl_crash.dump
|
|||
livebook-*.tar
|
||||
npm-debug.log
|
||||
/assets/node_modules/
|
||||
/priv/static_dev/
|
||||
/tmp/
|
||||
/livebook
|
||||
|
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -28,14 +28,6 @@ npm-debug.log
|
|||
# The directory NPM downloads your dependencies sources to.
|
||||
/assets/node_modules/
|
||||
|
||||
# During development we build assets from assets/
|
||||
# and they end up in priv/static_dev/, from where they are served.
|
||||
#
|
||||
# For deployment we build the assets to priv/static/
|
||||
# and commit to the reposity, because they have to be accessible
|
||||
# when building Escript locally.
|
||||
/priv/static_dev/
|
||||
|
||||
# The directory used by ExUnit :tmp_dir
|
||||
/tmp/
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ module.exports = (env, options) => {
|
|||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, (devMode ? '../priv/static_dev/js' : '../priv/static/js')),
|
||||
path: path.resolve(__dirname, (devMode ? '../tmp/static_dev/js' : '../priv/static/js')),
|
||||
publicPath: '/js/'
|
||||
},
|
||||
devtool: devMode ? 'eval-cheap-module-source-map' : undefined,
|
||||
|
|
|
@ -51,7 +51,7 @@ config :livebook, LivebookWeb.Endpoint,
|
|||
config :livebook, LivebookWeb.Endpoint,
|
||||
live_reload: [
|
||||
patterns: [
|
||||
~r"priv/static_dev/.*(js|css|png|jpeg|jpg|gif|svg)$",
|
||||
~r"tmp/static_dev/.*(js|css|png|jpeg|jpg|gif|svg)$",
|
||||
~r"lib/livebook_web/(live|views)/.*(ex)$",
|
||||
~r"lib/livebook_web/templates/.*(eex)$"
|
||||
]
|
||||
|
|
|
@ -28,13 +28,13 @@ defmodule LivebookWeb.Endpoint do
|
|||
|
||||
defmodule AssetsFileSystemProvider do
|
||||
use LivebookWeb.FileSystemProvider,
|
||||
from: {:livebook, "priv/static_dev"}
|
||||
from: {:livebook, "tmp/static_dev"}
|
||||
end
|
||||
|
||||
# Serve static failes at "/"
|
||||
|
||||
if code_reloading? do
|
||||
# In development we use assets from priv/static_dev (rebuilt dynamically on every change).
|
||||
# In development we use assets from tmp/static_dev (rebuilt dynamically on every change).
|
||||
# Note that this directory doesn't contain predefined files (e.g. images),
|
||||
# so we also use `AssetsMemoryProvider` to serve those from priv/static.
|
||||
plug LivebookWeb.StaticPlug,
|
||||
|
|
Loading…
Reference in a new issue