mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 14:10:04 +02:00
static subfolders for easier static hosting
This commit is contained in:
parent
286dafca16
commit
7661a34b27
5
ui/static/.gitignore
vendored
5
ui/static/.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
*
|
||||
!.gitignore
|
||||
!theme.css
|
||||
!.gitkeep
|
||||
!index.html
|
||||
!reboot.css
|
||||
|
||||
js/*
|
||||
!js/.gitkeep
|
||||
|
4
ui/static/css/.gitignore
vendored
Normal file
4
ui/static/css/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*
|
||||
!.gitignore
|
||||
!theme.css
|
||||
!reboot.css
|
@ -2,12 +2,12 @@
|
||||
<html lang='en-US'>
|
||||
<head>
|
||||
<title>Joyent UI Framework</title>
|
||||
<link href="/static/theme.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/reboot.css" rel="stylesheet" type="text/css">
|
||||
<link href="/static/docs.css" rel="stylesheet" type="text/css">
|
||||
<link href="css/theme.css" rel="stylesheet" type="text/css">
|
||||
<link href="css/reboot.css" rel="stylesheet" type="text/css">
|
||||
<link href="css/docs.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<div id='root'></div>
|
||||
<script src='/static/docs.js'></script>
|
||||
<script src='js/docs.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
|
0
ui/static/js/.gitkeep
Normal file
0
ui/static/js/.gitkeep
Normal file
@ -6,7 +6,7 @@ const cssFunctions = require('../src/shared/functions');
|
||||
const plugins = {
|
||||
'no-errors-plugin': new webpack.NoErrorsPlugin(),
|
||||
'extract-text-plugin': new ExtractTextPlugin({
|
||||
filename: '[name].css',
|
||||
filename: 'css/[name].css',
|
||||
allChunks: true
|
||||
}),
|
||||
'loader-options-plugin': new webpack.LoaderOptionsPlugin({
|
||||
@ -33,8 +33,8 @@ exports.config = {
|
||||
context: path.join(__dirname, '../'),
|
||||
output: {
|
||||
path: path.join(__dirname, '../static'),
|
||||
publicPath: '/static/',
|
||||
filename: '[name].js'
|
||||
publicPath: '/',
|
||||
filename: 'js/[name].js'
|
||||
},
|
||||
plugins: [
|
||||
plugins['no-errors-plugin'],
|
||||
|
@ -1,14 +1,17 @@
|
||||
const pkg = require('../package.json');
|
||||
const base = require('./base.js');
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
|
||||
const devServer = {
|
||||
contentBase: [
|
||||
path.join(__dirname, '../static/')
|
||||
],
|
||||
hot: true,
|
||||
compress: true,
|
||||
lazy: false,
|
||||
publicPath: '/static/',
|
||||
historyApiFallback: {
|
||||
index: './static/index.html'
|
||||
index: './index.html'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -82,11 +82,12 @@ module.exports = ({
|
||||
return fn(err);
|
||||
}
|
||||
|
||||
let style = mfs.readdirSync('/static').filter((file) => {
|
||||
// TODO read extract css defs
|
||||
let style = mfs.readdirSync('/static/css').filter((file) => {
|
||||
return /\.css$/.test(file);
|
||||
}).map((file) => {
|
||||
try {
|
||||
return mfs.readFileSync(`/static/${file}`, 'utf-8');
|
||||
return mfs.readFileSync(`/static/css/${file}`, 'utf-8');
|
||||
} catch (err) {
|
||||
return '';
|
||||
}
|
||||
|
@ -2,10 +2,11 @@ const WebpackShellPlugin = require('webpack-shell-plugin');
|
||||
const base = require('./base.js');
|
||||
const webpack = require('webpack');
|
||||
const entries = require('./entrypoints');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = Object.assign(base.config, {
|
||||
entry: entries.reduce((all, entry) => {
|
||||
all[entry.name] = [entry.path];
|
||||
all[entry.name] = [`./${path.relative(base.config.context, entry.path)}`];
|
||||
return all;
|
||||
}, {}),
|
||||
plugins: base.config.plugins.concat([
|
||||
|
Loading…
Reference in New Issue
Block a user