mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
commit
05085cbc99
@ -7,6 +7,9 @@
|
||||
|
||||
<script>
|
||||
<% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %>
|
||||
<% css.forEach(function (c) { %>
|
||||
import '<%= c.src || c %>'
|
||||
<% }) %>
|
||||
|
||||
let layouts = {
|
||||
<%
|
||||
@ -61,6 +64,3 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<% css.forEach(function (c) { %>
|
||||
<style src="<%= (typeof c === 'string' ? c : c.src) %>" lang="<%= (c.lang ? c.lang : 'css') %>"></style>
|
||||
<% }) %>
|
||||
|
@ -3,14 +3,12 @@
|
||||
import { each, defaults } from 'lodash'
|
||||
import webpack from 'webpack'
|
||||
import VueSSRClientPlugin from 'vue-server-renderer/client-plugin'
|
||||
import ExtractTextPlugin from 'extract-text-webpack-plugin'
|
||||
import HTMLPlugin from 'html-webpack-plugin'
|
||||
import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
|
||||
import ProgressBarPlugin from 'progress-bar-webpack-plugin'
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
|
||||
import OfflinePlugin from 'offline-plugin'
|
||||
import base from './base.config.js'
|
||||
import { extractStyles } from './helpers'
|
||||
import { resolve } from 'path'
|
||||
|
||||
/*
|
||||
|
3
test/fixtures/with-config/assets/app.css
vendored
Executable file
3
test/fixtures/with-config/assets/app.css
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
.global-css-selector {
|
||||
color: red;
|
||||
}
|
5
test/fixtures/with-config/nuxt.config.js
vendored
5
test/fixtures/with-config/nuxt.config.js
vendored
@ -31,5 +31,8 @@ module.exports = {
|
||||
extend (config, options) {
|
||||
config.devtool = 'nosources-source-map'
|
||||
}
|
||||
}
|
||||
},
|
||||
css: [
|
||||
{src: '~/assets/app.css'}
|
||||
]
|
||||
}
|
||||
|
@ -24,6 +24,11 @@ test('/', async t => {
|
||||
t.true(html.includes('<h1>I have custom configurations</h1>'))
|
||||
})
|
||||
|
||||
test('/ (global styles inlined)', async t => {
|
||||
const { html } = await nuxt.renderRoute('/')
|
||||
t.true(html.includes('.global-css-selector'))
|
||||
})
|
||||
|
||||
test('/ (custom app.html)', async t => {
|
||||
const { html } = await nuxt.renderRoute('/')
|
||||
t.true(html.includes('<p>Made by Nuxt.js team</p>'))
|
||||
|
Loading…
Reference in New Issue
Block a user