mirror of
https://github.com/yldio/copilot.git
synced 2024-11-10 21:30:06 +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
|
!.gitignore
|
||||||
!theme.css
|
!.gitkeep
|
||||||
!index.html
|
!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'>
|
<html lang='en-US'>
|
||||||
<head>
|
<head>
|
||||||
<title>Joyent UI Framework</title>
|
<title>Joyent UI Framework</title>
|
||||||
<link href="/static/theme.css" rel="stylesheet" type="text/css">
|
<link href="css/theme.css" rel="stylesheet" type="text/css">
|
||||||
<link href="/static/reboot.css" rel="stylesheet" type="text/css">
|
<link href="css/reboot.css" rel="stylesheet" type="text/css">
|
||||||
<link href="/static/docs.css" rel="stylesheet" type="text/css">
|
<link href="css/docs.css" rel="stylesheet" type="text/css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id='root'></div>
|
<div id='root'></div>
|
||||||
<script src='/static/docs.js'></script>
|
<script src='js/docs.js'></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</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 = {
|
const plugins = {
|
||||||
'no-errors-plugin': new webpack.NoErrorsPlugin(),
|
'no-errors-plugin': new webpack.NoErrorsPlugin(),
|
||||||
'extract-text-plugin': new ExtractTextPlugin({
|
'extract-text-plugin': new ExtractTextPlugin({
|
||||||
filename: '[name].css',
|
filename: 'css/[name].css',
|
||||||
allChunks: true
|
allChunks: true
|
||||||
}),
|
}),
|
||||||
'loader-options-plugin': new webpack.LoaderOptionsPlugin({
|
'loader-options-plugin': new webpack.LoaderOptionsPlugin({
|
||||||
@ -33,8 +33,8 @@ exports.config = {
|
|||||||
context: path.join(__dirname, '../'),
|
context: path.join(__dirname, '../'),
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, '../static'),
|
path: path.join(__dirname, '../static'),
|
||||||
publicPath: '/static/',
|
publicPath: '/',
|
||||||
filename: '[name].js'
|
filename: 'js/[name].js'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
plugins['no-errors-plugin'],
|
plugins['no-errors-plugin'],
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
const pkg = require('../package.json');
|
const pkg = require('../package.json');
|
||||||
const base = require('./base.js');
|
const base = require('./base.js');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
const devServer = {
|
const devServer = {
|
||||||
|
contentBase: [
|
||||||
|
path.join(__dirname, '../static/')
|
||||||
|
],
|
||||||
hot: true,
|
hot: true,
|
||||||
compress: true,
|
compress: true,
|
||||||
lazy: false,
|
lazy: false,
|
||||||
publicPath: '/static/',
|
|
||||||
historyApiFallback: {
|
historyApiFallback: {
|
||||||
index: './static/index.html'
|
index: './index.html'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -82,11 +82,12 @@ module.exports = ({
|
|||||||
return fn(err);
|
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);
|
return /\.css$/.test(file);
|
||||||
}).map((file) => {
|
}).map((file) => {
|
||||||
try {
|
try {
|
||||||
return mfs.readFileSync(`/static/${file}`, 'utf-8');
|
return mfs.readFileSync(`/static/css/${file}`, 'utf-8');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,11 @@ const WebpackShellPlugin = require('webpack-shell-plugin');
|
|||||||
const base = require('./base.js');
|
const base = require('./base.js');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const entries = require('./entrypoints');
|
const entries = require('./entrypoints');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = Object.assign(base.config, {
|
module.exports = Object.assign(base.config, {
|
||||||
entry: entries.reduce((all, entry) => {
|
entry: entries.reduce((all, entry) => {
|
||||||
all[entry.name] = [entry.path];
|
all[entry.name] = [`./${path.relative(base.config.context, entry.path)}`];
|
||||||
return all;
|
return all;
|
||||||
}, {}),
|
}, {}),
|
||||||
plugins: base.config.plugins.concat([
|
plugins: base.config.plugins.concat([
|
||||||
|
Loading…
Reference in New Issue
Block a user